colVars: Column and row-wise variances and standard deviations of a...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/colVars.R

Description

Column and row-wise variances and standard deviations of a matrix

Usage

1
2
3
colVars(x, suma = NULL, std = FALSE, parallel = FALSE)
rowVars(x, suma = NULL, std = FALSE)
groupcolVars(x, ina, std = FALSE)

Arguments

x

A matrix with the data.

suma

If you already have the column sums vector supply it, otherwise leave it NULL.

ina

A numerical vector specifying the groups. If you have numerical values, do not put zeros, but 1, 2, 3 and so on.

std

A boolean variable specyfying whether you want the variances (FALSE) or the standard deviations (TRUE) of each column.

parallel

Should parallel implentations take place in C++? The default value is FALSE.

Details

We found this in stackoverflow and was created by David Arenburg. We then modified the function to match the sums type formula of the variance, which is faster.

Value

A vector with the column variances or standard deviations.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <[email protected]> and Manos Papadakis <[email protected]>.

See Also

colmeans, colMedians, colrange

Examples

1
2
3
4
5
x <- matrix( rnorm(100 * 100), ncol = 100 )
a2 <- colVars(x)
groupcolVars( as.matrix(iris[, 1:4]), as.numeric(iris[, 5]) )

x<-a2<-NULL

Rfast documentation built on Nov. 18, 2017, 4 a.m.