Convert Saturday dates to epidatr::epirange with MMWR epiweeks
Source: R/date_utils.R
saturdays_to_epirange.RdConverts a sequence of Saturday dates (forecast hub convention) to an
epidatr::epirange object (Saturday-ending weeks in YYYYWW format).
Value
An epidatr::epirange object covering the epiweeks corresponding
to the input dates.
Details
The function:
Validates that all dates are Saturdays
Converts to MMWR epiweek format (YYYYWW) using lubridate
Returns an
epidatr::epirangespanning from the earliest to latest week