convert.to.XxYear | R Documentation |
Use this function to convert time-series data (currently implemented: daily) to time-series data with year-based frequency such as monthly, quarterly, yearly, etc.
convert.to.XxYear(variable, x, aggregateFun)
variable |
A variable. |
x |
Determines the number of partitions in each year, for example, use 12 for monthly data. |
aggregateFun |
Function to aggregate data within each interval. |
See the details section of the convert.to.daily
function.
A variable with year-based frequency.
startFreq <- f.daily(c(2023,1,1))
v <- variable(c(1:(365*2)), startFreq)
w <- convert.to.XxYear(v,12,function(x)mean(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.