Learn R Programming

nexus (version 0.3.0)

condense: Compositional Mean of Data Subsets

Description

Splits the data into subsets and computes compositional mean for each.

Usage

condense(x, ...)

# S4 method for CompositionMatrix condense(x, by = groups(x), ...)

Value

A CompositionMatrix object.

Arguments

x

A CompositionMatrix object.

...

Further arguments to be passed to mean().

by

A vector or a list of grouping elements, each as long as the variables in x. The elements are coerced to factors before use (in the sense that interaction(by) defines the grouping).

Author

N. Frerebeau

See Also

mean(), aggregate()

Other statistics: aggregate(), covariance(), dist, mahalanobis(), margin(), mean(), pip(), quantile(), scale(), variance(), variance_total(), variation()

Examples

Run this code
## Data from Aitchison 1986
data("slides")

## Coerce to a compositional matrix
coda <- as_composition(slides, groups = 2)

## Compositional mean by group
condense(coda)

Run the code above in your browser using DataLab