convert.to.weekly {tdata} | R Documentation |
Convert Data to Weekly Frequency
Description
Use this function to convert time-series data (currently implemented: daily) to time-series data with weekly frequency.
Usage
convert.to.weekly(variable, weekStart, aggregateFun)
Arguments
variable |
A variable. |
weekStart |
Determines the start day of the week, can be |
aggregateFun |
Function to aggregate data within each interval. |
Details
See the details section of the convert.to.daily
function.
Value
A variable with weekly frequency.
Examples
startFreq <- f.daily(c(2022, 9, 1))
v <- variable(c(1,2,3,4,5,6,7,8), startFreq)
w <- convert.to.weekly(v, "mon", function(x)mean(x, na.rm=TRUE))
[Package tdata version 0.3.0 Index]