ccodwg/Covid19CanadaDashboard

Add support for SK's new boundaries

Closed this issue · 5 comments

Since SK has not provided an historical dataset for their new health region boundaries, we have been forced to maintain a parallel dataset with an approximation of the old boundaries to have a continuous dataset for this province. However, we should have support for the new SK boundaries, although this will only allow data to displayed from the beginning of the time series for the new health region (August 4).

Updated scripts to display SK with the new HR boundaries for user input dates at: i) the start date of cases (January 25th 2020) and past August 4th 2020; ii) beginning dates on or past August 4th 2020. For time series not meeting these conditions, the old SK boundaries will be displayed.

This makes use of a parallel map file, hr_map_new.csv to be added to the Covid19Canada/other/ file. N.B. Population for the new HRs is still required.

Thanks, @kbelisar. For now, I manually added hr_map_new.csv to the data folder of the dashboard (eventually we will integrate it into the main Covid19Canada repository).

The absolute case and mortality numbers work great with the new boundaries. However, I have discovered an error under one of the following scenarios:

  • Start date: 2021-01-25 / End date: 2021-08-04 / Works fine, displays new boundaries (as expected)
  • Start date: 2021-01-26 / End date: 2021-08-04 / Works fine, displays old boundaries (as expected)
  • Start date: 2021-01-26 / End date: 2021-08-03 / Works fine, displays old boundaries (as expected)
  • Start date: 2021-01-25 / End date: 2021-08-03 / ERROR (expected: displays old boundaries)

The error is below:

Warning: Error in select: object 'dat' not found
  103: <Anonymous>

Also, I noticed you added a dependency for data.table. Would it be possible to convert this code into tidyverse so we can stay consistent and avoid adding another dependency?

Thanks for your hard work on this!

Great @jeanpaulrsoucy, catch about the start dates -- needed another if else statement added. Now it works! I was so excited about getting the boundaries working!!

And I don't actually use the data.table, but for some reason I cannot get the app to load without adding it on my end.

Will push the latest version.

We have now received the population estimates for the new Saskatchewan HRs, allowing for per capita estimates.