condense function

Compositional Mean of Data Subsets

Compositional Mean of Data Subsets

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

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

Arguments

  • x: A CompositionMatrix object.
  • ...: Currently not used.
  • by: A vector or a list of grouping elements, each as long as the variables in x (see group()).
  • ignore_na: A logical scalar: should missing values be stripped before the computation proceeds?
  • ignore_zero: A logical scalar: should zeros be stripped before the computation proceeds?
  • verbose: A logical scalar: should report extra information on progress?

Returns

A CompositionMatrix object.

Examples

## Data from Aitchison 1986 data("slides") ## Coerce to a compositional matrix coda <- as_composition(slides, groups = 2) ## Compositional mean by group condense(coda)

See Also

mean(), aggregate()

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

Author(s)

N. Frerebeau