Learn R Programming

SimDesign (version 2.17.1)

colVars: Form Column Standard Deviation and Variances

Description

Form column standard deviation and variances for numeric arrays (or data frames).

Usage

colVars(x, na.rm = FALSE, unname = FALSE)

colSDs(x, na.rm = FALSE, unname = FALSE)

Arguments

x

an array of two dimensions containing numeric, complex, integer or logical values, or a numeric data frame

na.rm

logical; remove missing values in each respective column?

unname

logical; apply unname to the results to remove any variable names?

Author

Phil Chalmers rphilip.chalmers@gmail.com

See Also

Examples

Run this code

results <- matrix(rnorm(100), ncol=4)
colnames(results) <- paste0('stat', 1:4)

colVars(results)
colSDs(results)

results[1,1] <- NA
colSDs(results)
colSDs(results, na.rm=TRUE)
colSDs(results, na.rm=TRUE, unname=TRUE)

Run the code above in your browser using DataLab