convert.to.XxYear {tdata} | R Documentation |
Convert Data to Year-Based Frequency
Description
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.
Usage
convert.to.XxYear(variable, x, aggregateFun)
Arguments
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. |
Details
See the details section of the convert.to.daily
function.
Value
A variable with year-based frequency.
Examples
startFreq <- f.daily(c(2023,1,1))
v <- variable(c(1:(365*2)), startFreq)
w <- convert.to.XxYear(v,12,function(x)mean(x))
[Package tdata version 0.3.0 Index]