numeric, 1 indicates rows are to be summed/averaged,
2 indicates columns are to be summed/averaged.
c(1, 2) is not yet implemented, but can be calculated
calling the function twice.
by
a vector of grouping elements corresponding to dimensions
of object and MARGIN.
replace
a data frame to be used when applying the method on a
"Mefa" object. The attribute table
corresponding to MARGIN is dropped (NULL),
replacement table can be specified via this argument.
na.rm
logical. Should missing values be removed?
Sum is calculated by zeroing out NA values,
mean is calculated as dividing the sum by the number of
non-NA values when collapsing.
...
other argument, currently not implemented.
Details
The method sums/averages cells in a matrix.
The functions behind these methods use sparse matrices,
so calculations can be more efficient compared to using
aggregate.
Value
An object similar to the input one.
Author(s)
Peter Solymos <solymos@ualberta.ca>
See Also
rowSums, rowMeans,
colSums, colMeans
Standard aggregate in package stats
aggregate.mefa in package
mefa for S3 "mefa" objects.