powered by
col01scale and colcenter (re)scale the columns of a matrix. These are simple one-line utilities, mainly with a didactical purpose.
col01scale
colcenter
colcenter (mat) col01scale(mat, scale.func = function(x) diff(range(x)), location.func = mean)
a matrix with the same attributes as the input mat.
mat
numeric matrix, to rescaled.
two functions mapping a numeric vector to a single number.
Martin Maechler
The standard R function scale().
scale()
## See the simple function definitions: colcenter ## simply one line col01scale# almost as simple
Run the code above in your browser using DataLab