inst/examples/ex-aggregate.R

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

## Coerce to a compositional matrix
coda <- as_composition(slides)

## Compositional mean by slide
aggregate(coda, by = slides$slide, FUN = mean)

## Metric variance by slide
aggregate(coda, by = slides$slide, FUN = variance_total)

Try the nexus package in your browser

Any scripts or data that you put into this service are public.

nexus documentation built on June 8, 2025, 11:12 a.m.