This program scales each column of a data frame or a matrix to [0,1] range, computing ((X)ij - (Xmin)i) / range((X)i) for each individual j of the variable i or to [-1,1] range computing 2 *((X)ij - (Xmin)i) / range((X)i) -1

aue.rescale(dfm, method = c("zero.one", "one.one"))

Arguments

dfm

Data frame, matrix or vector to scale.

method

Scaling method: "zero.one" for scaling to [0, 1], "one-one" for scaling to [-1,1].

Examples

# NOT RUN { data(eco.test) require(adegenet) pc <- dudi.pca(eco[["P"]], scannf = FALSE, nf = 3) pc <- pc$li pc <- aue.rescale(pc) plot(eco[["XY"]][, 1], eco[["XY"]][, 2], col = rgb(pc), pch = 16, cex = 1.5, xlab ="X", ylab= "Y") # }