-
Notifications
You must be signed in to change notification settings - Fork 0
/
bccovid.R
67 lines (63 loc) · 2.02 KB
/
bccovid.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#' COVID 19 Cases in BC for the last year
#'
#' This data is the number of reported COVID-19 cases in British
#' Columbia between January 2020 and April 15, 2023. The values are.up-to-date
#' as of August 2023.
#'
#'
#' @details
#' The full data (`bccovid`), contains the case count for BC.
#'
#' The other data has been processed from this raw file. First, it is separated
#' out by Health Authority. Then it was
#' "smoothed" by applying a 7 day trailing sum. By this we mean that,
#'
#' ```r
#' cases_today = sum(cases_7days_ago:cases_today)
#' ```
#'
#' The result is in the `cases+0` column. The other columns are "shifts" of this
#' value. `cases+14` is the response: it is the total number of cases observed
#' in the week ending 14 days after `date`. The other `cases` variables are
#' features: the total number of cases in the week ending on the `date`
#' (`cases+0`), 1 week earlier (`cases-7`) and 2 weeks earlier (`cases-14`).
#' `HA` is the name of the BC Health Authority. There are 5 different `HA`s,
#' and UBC is located in "Vancouver Coastal" along with Kitsilano and Downtown.
#' SFU, Burnaby, Richmond, and Surrey are all in "Fraser".
#'
#' @source This data comes from the British Columbia CDC
#' [linelist](http://www.bccdc.ca/Health-Info-Site/Documents/BCCDC_COVID19_Dashboard_Case_Details.csv)
#' via the [`{CanCovidData}`](https://mountainmath.github.io/CanCovidData/) package.
#'
#' @examples
#' bccovid
#'
"bccovid"
#' @details
#' `bccovid_train` is the Training set for use on the homework.
#' It contains only the data prior to 1 August 2021.
#'
#' @rdname bccovid
#' @examples
#' bccovid_train
#'
"bccovid_train"
#' @details
#' `bccovid_test` is the Test set for use on the homework.
#' It contains `r length(unique(bccovid_test$date))` rows
#' of the data (between 1 August 2021 and 1 December 2021).
#'
#' @rdname bccovid
#' @examples
#' bccovid_test
#'
"bccovid_test"
#' @details
#' `bcpop` gives the number of people living in each BC Health Authority as of
#' the 2020 Census
#'
#' @rdname bccovid
#' @examples
#' bcpop
#'
"bcpop"