condense: Compositional Mean of Data Subsets

condenseR Documentation

Compositional Mean of Data Subsets

Description

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

Usage

condense(x, ...)

## S4 method for signature 'CompositionMatrix'
condense(x, by, verbose = FALSE, ...)

## S4 method for signature 'GroupedComposition'
condense(x, by = NULL, verbose = FALSE, ...)

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 (see group()).

verbose

A logical scalar: should R report extra information on progress?

Value

A CompositionMatrix object.

Author(s)

N. Frerebeau

See Also

mean(), aggregate()

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

Examples

## Data from Aitchison 1986
data("slides")

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

## Compositional mean by group
condense(coda)

nexus documentation built on April 4, 2025, 1:12 a.m.