aggregate | R Documentation |
Splits the data into subsets, computes summary statistics for each, and returns the result.
## S4 method for signature 'CompositionMatrix'
aggregate(x, by, FUN, ..., simplify = TRUE, drop = TRUE)
x |
A |
by |
A |
FUN |
A |
... |
Further arguments to be passed to |
simplify |
A |
drop |
A |
A matrix
.
N. Frerebeau
Other statistics:
condense()
,
covariance()
,
dist
,
mahalanobis()
,
margin()
,
mean()
,
pip()
,
quantile()
,
scale()
,
variance()
,
variance_total()
,
variation()
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.