Skip to content

Commit

Permalink
Update AB case data
Browse files Browse the repository at this point in the history
- Use geospatial data/summary data after 2020-04-01, because these datasets end 2023-08-28 rather than 2023-07-24 like the final version of the COVID-19 statistics app (ccodwg/CovidTimelineCanada#116)
  • Loading branch information
jeanpaulrsoucy committed Oct 3, 2023
1 parent b86bab0 commit 90904b7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion R/assemble_final_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,23 @@ assemble_final_datasets <- function() {
# case dataset

## ab
cases_ab <- read_d("raw_data/static/ab/ab_cases_hr_ts.csv") %>%
ab1 <- read_d("raw_data/static/ab/ab_cases_hr_ts_1.csv") %>%
convert_hr_names() %>%
dplyr::filter(.data$date <= as.Date("2020-03-31"))
ab2 <- read_d("raw_data/static/ab/ab_cases_hr_ts_2.csv") %>%
convert_hr_names()
ab3 <- read_d("raw_data/static/ab/ab_cases_pt_ts.csv") %>%
dplyr::filter(.data$date >= as.Date("2020-04-01"))
# calculate time series for "unknown" health region based on diff between PT and agg HR
ab4 <- ab2 %>%
dplyr::select(-.data$sub_region_1) %>%
dplyr::group_by(.data$name, .data$region, .data$date) %>%
dplyr::summarize(value = sum(.data$value), .groups = "drop")
ab5 <- ab3 %>%
add_hr_col("Unknown")
ab5$value <- ab5$value - ab4$value
cases_ab <- dplyr::bind_rows(ab1, ab2, ab5)
rm(ab1, ab2, ab3, ab4, ab5) # clean up

## bc
bc1 <- read_d("raw_data/static/bc/bc_cases_hr_ts.csv") %>%
Expand Down

0 comments on commit 90904b7

Please sign in to comment.