FUN
applied to a partition of the original time series.
aggregate(x, nfrequency=1, FUN=sum, ndeltat=1, ts.eps = .Options$ts.eps, ..., fun)
FUN
accepts them.
x
.
FUN
is either
mean
, to give the mean
level for rate-like series, or
FUN
is
sum
in order to compute totals.
deltat(x)
.
The resulting series has frequency
1/ndeltat
.
If
nfrequency
is given, this is ignored.
options("ts.eps")
.
Frequencies are considered equal if they differ in absolute value by less than ts.eps.
FUN
.
FUN
. Please do not use this.
nfrequency
.
Each group of
frequency(x)/nfrequency
observations is given to
FUN
to create the aggregated value. (Incomplete cycles are ignored.)
These are the
"rts"
and
"cts"
methods for the generic function
aggregate
.
The third argument,
FUN
,
used to be called lowercase
fun
,
which did not match the name of this argument in other methods
for
aggregate
. We have changed
the name to
FUN
but
fun
is still accepted. However, abbreviations of
fun
are not recognized and will be passed to
FUN
as
part of the
...
list.
aggregate(co2, 1, mean) # yearly co2 level aggregate(ship, 4, sum) # quarterly manufacturing shipments aggregate(ship, ndeltat=.25) # same as above aggregate(lynx, nfrequency=frequency(lynx)/3, FUN=mean) # aggregate lynx every 3 observations