Skip to content

Commit

Permalink
Switch to ON MOH dataset
Browse files Browse the repository at this point in the history
- Advantages compared to PHO dataset: single dataset, daily data, more timely
- Disadvantages: could be retired at any time
- ccodwg/CovidTimelineCanada#118
  • Loading branch information
jeanpaulrsoucy committed Oct 12, 2023
1 parent 5df287a commit 29c4107
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 1 addition & 7 deletions R/assemble_final_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,8 @@ assemble_final_datasets <- function() {
)

## on
on1 <- read_d("raw_data/static/on/on_cases_hr_ts.csv") |>
cases_on <- read_d("raw_data/active_ts/on/on_cases_hr_ts.csv") |>
convert_hr_names()
on2 <- read_d("raw_data/reports/on/on_pho_cases.csv") |>
report_pluck("cases", "cases_weekly", "value_daily", "hr") |>
dplyr::filter(.data$date >= as.Date("2023-09-02")) |>
convert_hr_names()
cases_on <- append_daily_d(on1, on2)
rm(on1, on2) # clean up

## pe
cases_pe <- dplyr::bind_rows(
Expand Down
1 change: 1 addition & 0 deletions R/dl_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dl_datasets <- function() {
# nt
# nu
# on
"921649fa-c6c0-43af-a112-23760da4d622", NA, NA, # c
"75dd0545-f728-4af5-8185-4269596785ef", NA, NA, # d (pt)
"4b214c24-8542-4d26-a850-b58fc4ef6a30", NA, NA, # h, i
# pe
Expand Down
8 changes: 8 additions & 0 deletions R/update_raw_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ update_active_ts <- function(ds) {
ds = load_ds(ds, "b19daaca-6b32-47f5-944f-c69eebd63c07")) %>%
write_ts("active_ts", "nl", "cases")

## on
Covid19CanadaDataProcess::process_dataset(
uuid = "921649fa-c6c0-43af-a112-23760da4d622",
val = "cases",
fmt = "hr_ts",
ds = load_ds(ds, "921649fa-c6c0-43af-a112-23760da4d622")) %>%
write_ts("active_ts", "on", "cases")

## qc
Covid19CanadaDataProcess::process_dataset(
uuid = "3b93b663-4b3f-43b4-a23d-cbf6d149d2c5",
Expand Down

0 comments on commit 29c4107

Please sign in to comment.