data-raw/DATASET.R

## code to prepare `DATASET` dataset goes here

mi_covid <- readxl::read_excel("./data-raw/data.xlsx") |>
  dplyr::group_by(Date) |>
  dplyr::summarise(
    Cases = sum(Cases),
    Deaths = sum(Deaths)
  ) |>
  dplyr::mutate(
    Cases = as.integer(Cases),
    Deaths = as.integer(Deaths),
    Cases_MA = zoo::rollapply(Cases, 7, mean, align = "center", fill = 0),
    Deaths_MA = zoo::rollapply(Deaths, 7, mean, align = "center", fill = 0)
  )

usethis::use_data(mi_covid, mi_covid, overwrite = TRUE)
adamddh/ds303pkg documentation built on April 14, 2022, 9:42 a.m.