Last data update: 2014.03.03

R: Variance matrices of a folder of data sets
varfR Documentation

Variance matrices of a folder of data sets

Description

Computes the variance matrices of the elements of an object of class folder.

Usage

varf(fold, use = "everything")

Arguments

fold

an object of class folder. The attribute attr(,"same.cols") must be TRUE (otherwise, there is an error).

use

an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs" (see var).

Details

This function can only be applied to a folder of data frames with the same column names. If attr(fold,"same.cols") = FALSE, there is an error.

It uses var to compute the variance matrix of the numeric columns of each element of the folder. If some columns of the data frames are not numeric, there is a warning, and the variances are computed on the numeric columns only.

Value

A list whose elements are the variance matrices of the elements of the folder.

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Sabine Demotes-Mainard

Maintainer: Rachid Boumaza <rachid.boumaza@agrocampus-ouest.fr>

See Also

folder to create an object is of class folder. meanf, corf, skewnessf, kurtosisf for other statistics for folder objects.

Examples

# First example: iris (Fisher)               
data(iris)
iris.fold <- df2folder(iris, "Species")
iris.vars <- varf(iris.fold)
print(iris.vars)

# Second example: roses
data(roses)
roses.fold <- df2folder(roses, "Lot")
roses.vars <- varf(roses.fold)
print(roses.vars)

Results