colSds: sd for each column

View source: R/colSds.R

colSdsR Documentation

sd for each column

Description

This function is speed optimized sd per column of a matrix or data.frame and treats each column as independent set of data for sd (equiv to apply(dat,2,sd)). NAs are ignored from data. Speed improvements may be seen at more than 100 columns

Usage

colSds(dat, silent = FALSE, debug = FALSE, callFrom = NULL)

Arguments

dat

matrix (or data.frame) with numeric values (may contain NAs which will be ignored)

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allows easier tracking of messages produced

Value

numeric vector of sd values

See Also

sd

Examples

set.seed(2016); dat1 <- matrix(c(runif(200) +rep(1:10,20)), ncol=10)
colSds(dat1)

wrMisc documentation built on Sept. 11, 2024, 6:10 p.m.