View source: R/statisticbygroup.R
StatisticsByGroup | R Documentation |
StatisticsByGroup
StatisticsByGroup(x, group, weights = NULL, FUN = Mean)
x |
A |
group |
A variable indicating group membership. Either a factor or coerced to a factor. |
weights |
The sampling or replication weights. |
FUN |
A function that can handle a weight argument. |
## Two variables with a single observation and a single group
dat <- matrix(c(1.0, 2.0), 1, 2)
stopifnot(identical(unname(StatisticsByGroup(dat, 1)), dat))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.