aggregate | R Documentation |
Makes a frequency change of this series.
aggregate(
s,
nfreq = 1,
conversion = c("Sum", "Average", "First", "Last", "Min", "Max"),
complete = TRUE
)
s |
the input time series. |
nfreq |
the new frequency. Must be la divisor of the frequency of |
conversion |
Aggregation mode: sum ( |
complete |
Boolean indicating if the observation for a given period in the new series is set missing if some data in the original series are missing. |
A new time series of frequency nfreq
.
s <- ABS$X0.2.09.10.M
# Annual sum
aggregate(s, nfreq = 1, conversion = "Sum") # first and last years removed
aggregate(s, nfreq = 1, conversion = "Sum", complete = FALSE)
# Quarterly mean
aggregate(s, nfreq = 4, conversion = "Average")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.