colSds: Row and column standard deviations

Description Usage Arguments Value Author(s) See Also Examples

View source: R/colSds.R

Description

The rowSds and colSds respectively computes the standard deviations of each rows and columns of the given matrix.

Usage

1
2
3
colSds(x)

rowSds(x)

Arguments

x

A numeric matrix of size n times m

Value

colSds returns a numeric vector of length m.

rowSds returns a numeric vector of length n.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau@gmail.com>

See Also

rowMeans, colMeans

Examples

1
2
3
4
5
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)

Example output

[1] 0.5273957 1.2613244 0.6286734 1.1457944 0.6470056
[1] 0.5273957 1.2613244 0.6286734 1.1457944 0.6470056
 [1] 1.2093397 0.8866277 0.7434449 1.2201824 1.2391023 0.7913162 1.8792884
 [8] 0.9888032 0.5893817 1.0090453

GMCM documentation built on Nov. 6, 2019, 1:08 a.m.