calc_forecast_week_end_date: Calculate end date for the week a forecast was made.

View source: R/date_management.R

calc_forecast_week_end_dateR Documentation

Calculate end date for the week a forecast was made.

Description

Following https://github.com/reichlab/covid19-forecast-hub/blob/master/data-processed/README.md, "For week-ahead forecasts with forecast_date of Sunday or Monday of EW12, a 1 week ahead forecast corresponds to EW12 and should have target_end_date of the Saturday of EW12." This means that the forecast week end date is set to Saturday of EW11 (the previous week) for Sunday and Monday of EW12, and Saturday of EW12 (the current week) for Tuesday through Saturday of EW12.

Usage

calc_forecast_week_end_date(forecast_date)

Arguments

forecast_date

character vector of dates in 'yyyy-mm-dd' format

Value

character vector of dates in 'yyyy-mm-dd' format


reichlab/covidHubUtils documentation built on Feb. 6, 2024, 1:42 p.m.