Learn R Programming

dad (version 4.1.6)

var.folder: Variance matrices of a folder of data sets

Description

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

Usage

var.folder(x, na.rm = FALSE, use = "everything")

Value

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

Arguments

x

an object of class folder that is a list of data frames with the same column names.

na.rm

logical. Should missing values be removed? (see var)

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).

Author

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

Details

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.

See Also

folder to create an object is of class folder. mean.folder, cor.folder, skewness.folder, kurtosis.folder for other statistics for folder objects.

Examples

Run this code
# First example: iris (Fisher)               
data(iris)
iris.fold <- as.folder(iris, "Species")
iris.vars <- var.folder(iris.fold)
print(iris.vars)

# Second example: roses
data(roses)
roses.fold <- as.folder(roses, "rose")
roses.vars <- var.folder(roses.fold)
print(roses.vars)

Run the code above in your browser using DataLab