Skip to contents

Converts a sequence of Saturday dates (forecast hub convention) to an epidatr::epirange object (Saturday-ending weeks in YYYYWW format).

Usage

saturdays_to_epirange(dates)

Arguments

dates

A vector of dates. Must all be Saturdays.

Value

An epidatr::epirange object covering the epiweeks corresponding to the input dates.

Details

The function:

  1. Validates that all dates are Saturdays

  2. Converts to MMWR epiweek format (YYYYWW) using lubridate

  3. Returns an epidatr::epirange spanning from the earliest to latest week