Skip to contents

Add rows to a data frame with `cases_this_period` and `period_end_date` for representing missing weeks. TODO: generalize to other time scales.

Usage

pad_weeks(data, ...)

Arguments

data

Data frame with a cases_this_period columns and a period_end_date column that is spaced weekly (but possibly with gaps).

...

Passed on to data.frame to create new constant columns.

Value

The input `data` but with new rows for missing weeks. These rows have `NA` in `cases_this_period` and other columns that are not passed through `...` or that were not constant in the input `data` (in which case these constant values are passed on to the output data frame).

Details

Could use https://github.com/EdwinTh/padr.