Skip to contents

Places each case on its paralysis onset date. A record that the laboratory still holds can reach POLIS with no onset date, so the case date is used next and the date the first stool was collected after that.

Usage

spi_case_date(cases, cols = list())

Arguments

cases

Data frame of AFP cases, one row per case.

cols

Named list overriding the column names. This function reads onset_date (default "paralysis_onset_date"), case_date (default "case_date") and stool1_date (default "stool1collection_date").

Value

Date vector with one element per row of cases. It is NA where none of the three dates is recorded.

See also

Examples

cases <- tibble::tibble(
  paralysis_onset_date = as.Date(c("2024-01-05", NA, NA)),
  case_date = as.Date(c(NA, "2024-02-01", NA)),
  stool1collection_date = as.Date(c(NA, NA, "2024-03-09"))
)
spi_case_date(cases)
#> [1] "2024-01-05" "2024-02-01" "2024-03-09"