Row and column standard deviations
The rowSds
and colSds
respectively computes the standard deviations of each rows and columns of the given matrix.
colSds(x) rowSds(x)
x
: A numeric matrix of size n
times m
colSds
returns a numeric vector of length m
.
rowSds
returns a numeric vector of length n
.
x <- matrix(rnorm(50), 10, 5) GMCM:::colSds(x) apply(x, 2, sd) # slower equivalent code y <- matrix(rnorm(50), 10, 5) GMCM:::rowSds(y)
rowMeans
, colMeans
Anders Ellern Bilgrau anders.ellern.bilgrau@gmail.com