Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

standardise

Standardisation


Description

Standardisation.

Usage

standardise(x, center = TRUE, scale = TRUE)

Arguments

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)?

Details

Similar to R's built in functions "scale" there is the option for centering or scaling only or both (default).

Value

A matrix with the standardised data.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@yahoo.gr> and Manos Papadakis <papadakm95@gmail.com>.

See Also

Examples

x <- matrnorm( 100, 100 )
a1 <- scale(x)[1:100, ] 
a2 <- standardise(x) 
all.equal(as.vector(a1), as.vector(a2))
x <- NULL

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.