powered by
This function computes the weekly aggregates or differences (by default Friday to Friday) for any daily time series in the xts format.
to_weekly(x, incl_forecast = T, forecast_length = 365, diff = T, dayofweek = 5)
input series
whether the series contains a forecast that shall be omitted
length of forecast
should series be differenced
which day of the week (friday=5)
# NOT RUN { to_weekly(xts::xts(rnorm(365, 10,1), seq.Date(as.Date("2010-01-01"), length.out=365, by="days"))) # }
Run the code above in your browser using DataLab