|
1 | | -## code to prepare `can_prov_cases_dt` dataset goes here |
| 1 | +## code to prepare `can_prov_cases_tbl` dataset goes here |
2 | 2 |
|
3 | 3 | library(dplyr) |
4 | 4 | library(readr) |
@@ -108,7 +108,7 @@ ca_pop <- read_csv( |
108 | 108 | abbrev_map <- setNames(ca_pop$province, ca_pop$abbreviation) |
109 | 109 |
|
110 | 110 | # Read in data |
111 | | -can_prov_cases_dt <- purrr::map2(commit_pages$data_url, commit_pages$date, function(url, date) { |
| 111 | +can_prov_cases_tbl <- purrr::map2(commit_pages$data_url, commit_pages$date, function(url, date) { |
112 | 112 | raw <- readr::read_csv( |
113 | 113 | url, |
114 | 114 | col_types = cols( |
@@ -140,15 +140,15 @@ can_prov_cases_dt <- purrr::map2(commit_pages$data_url, commit_pages$date, funct |
140 | 140 | return(result) |
141 | 141 | }) |
142 | 142 |
|
143 | | -names(can_prov_cases_dt) <- commit_pages$date |
144 | | -can_prov_cases_dt <- can_prov_cases_dt %>% bind_rows(.id = "version") %>% |
| 143 | +names(can_prov_cases_tbl) <- commit_pages$date |
| 144 | +can_prov_cases_tbl <- can_prov_cases_tbl %>% bind_rows(.id = "version") %>% |
145 | 145 | mutate(version = lubridate::ymd(version)) %>% |
146 | 146 | arrange(version) %>% |
147 | 147 | as_tibble() |
148 | 148 |
|
149 | 149 | # We're trying to do: |
150 | | -# usethis::use_data(can_prov_cases_dt, internal = TRUE, overwrite = TRUE, compress = "xz") |
| 150 | +# usethis::use_data(can_prov_cases_tbl, internal = TRUE, overwrite = TRUE, compress = "xz") |
151 | 151 | # but `usethis::use_data` can only store multiple objects if they're added in |
152 | 152 | # the same call. This workaround is from |
153 | 153 | # https://github.com/r-lib/usethis/issues/1512 |
154 | | -save_to_sysdata(can_prov_cases_dt, "can_prov_cases_dt") |
| 154 | +save_to_sysdata(can_prov_cases_tbl, "can_prov_cases_tbl") |
0 commit comments