Arguments
ts
xts object to aggregate.
FUN
function to apply over each interval. By default, previous tick aggregation is done.
Alternatively one can set e.g. FUN="mean".
In case weights are supplied, this argument is ignored and a weighted average is taken.
on
character, indicating the time scale in which "k" is expressed. Possible values are: "secs", "seconds", "mins", "minutes","hours", "days", "weeks".
k
positive integer, indicating the number of periods to aggregate over. E.g. to aggregate a
xts object to the 5 minute frequency set k=5 and on="minutes".
weights
By default, no weighting scheme is used.
When you assign an xts object with wheights to this argument, a weighted mean is taken over each interval.
Of course, the weights should have the same timestamps as the supplied time series.
dropna
boolean, which determines whether empty intervals should be dropped.
By default, an NA is returned in case an interval is empty, except when the user opts
for previous tick aggregation, by setting FUN="previoustick" (default).