aggregate-methods {surveillance} | R Documentation |
"sts"
Object Over Time or Across UnitsMethod to aggregate the matrix slots of an sts object.
Either the time series is aggregated so a new sampling frequency of
nfreq
units per time slot is obtained (i.e as in
aggregate.ts
) or the aggregation is over all
ncol
units.
Note: The function is not 100% consistent with what the generic
function aggregate
does.
an object of class sts
a string being either "time" or "unit"
new sampling frequency if by=="time"
. If
nfreq=="all"
then all time instances are summed.
not used
returns an object of class sts
Aggregation by unit sets the upperbound slot to
NA
and the map
slot is left as-is, but the object
cannot be plotted by unit any longer.
The populationFrac slot is aggregated just like the observed slot
and population fractions are recomputed. This might not be
intended, especially for aggregation over time.
data("ha.sts") dim(ha.sts) dim(aggregate(ha.sts,by="unit")) dim(aggregate(ha.sts,nfreq=13))