aggreg | R Documentation |
Splits a numeric vector or matrix into subsets, computes summary statistics for each, and returns the result in a convenient form.
aggreg(x, y = NULL, fun = NULL, verbose = F, y.is.dummy = F, attr = F)
x |
Numeric vector or matrix. |
y |
Vector or matrix specifying the subsets to compute summary statistics for. |
fun |
Function specifying the summary statistic to compute. If NULL (default), mean is calculated. |
verbose |
Logical value specifying the verbocity of output. Defaults to F. |
y.is.dummy |
Logical value specifying whether y is already dummy-coded and thus does not have to be converted. Defaults to F. |
attr |
Logical value specifying whether subset-sizes should be added as an attribute of the returned result. |
Splits a numeric vector or matrix into subsets, computes summary statistics for each, and returns the result in a convenient form.
aggreg(x=1:10,y=c(rep(1,5),rep(2,5)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.