colScale: Scale columns of a matrix
Description
Same as base::scale()
but much faster.
Usage
colScale(x, add_attr = TRUE)
Arguments
add_attr
If TRUE, the column means and standard deviations are returned as attributes. This is consistent with base::scale()
.
Reference
This function was adopted from John Muschelli's code on StackOverflow, but I changed the underlying functions to calculate mean and standard deviation from matrixStats
to Rfast
, which is much faster.