A function to center (subtract mean) and/or scale (divide by standard deviation) data column-wise in a computationally efficient way.
scaler(x, center = TRUE, scale = TRUE)
The input matrix.
Logical; determine if the data should be centered and/or scaled.
The centered/scaled data, with attributes as in R's scale()
.
Unlike its R counterpart scale()
, the arguments
center
and scale
can only be logical values
(and not vectors).