ts_frequency | R Documentation |
Changes the frequency of a time series. By default, incomplete periods of regular series are omitted.
ts_frequency(
x,
to = c("year", "quarter", "month", "week", "day", "hour", "min", "sec"),
aggregate = "mean",
na.rm = FALSE
)
x |
ts-boxable time series, an object of class |
to |
desired frequency, either a character string ( |
aggregate |
character string, or function. Either |
na.rm |
logical, if |
The tempdisagg package
can convert low frequency to high frequency data and
has support for ts-boxable objects. See
vignette("hf-disagg", package = "tempdisagg")
.
a ts-boxable time series, with the same class as the input.
ts_frequency(cbind(mdeaths, fdeaths), "year", "sum")
ts_frequency(cbind(mdeaths, fdeaths), "quarter", "last")
ts_frequency(AirPassengers, 4, "sum")
# Note that incomplete years are omited by default
ts_frequency(EuStockMarkets, "year")
ts_frequency(EuStockMarkets, "year", na.rm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.