powered by
Use this function to convert time-series data (currently implemented: daily) to time-series data with weekly frequency.
convert.to.weekly(variable, weekStart, aggregateFun)
A variable with weekly frequency.
A variable.
Determines the start day of the week, can be sun, mon, tue, wed, thu, fri, or sat.
sun
mon
tue
wed
thu
fri
sat
Function to aggregate data within each interval.
See the details section of the convert.to.daily function.
convert.to.daily
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))
Run the code above in your browser using DataLab