Standardisation | R Documentation |
Standardisation.
standardise(x, center = TRUE, scale = TRUE)
x |
A matrix with data. It has to be matrix, if it is data.frame for example the function does not turn it into a matrix. |
center |
Should the data be centred as well? TRUE or FALSE. |
scale |
Should the columns have unit variance, yes (TRUE) or no (FALSE)? |
Similar to R's built in functions "scale" there is the option for centering or scaling only or both (default).
A matrix with the standardised data.
Michail Tsagris
R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.
colVars, colmeans, colMads
x <- matrnorm( 100, 100 )
a1 <- scale(x)[1:100, ]
a2 <- standardise(x)
all.equal(as.vector(a1), as.vector(a2))
x <- NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.