Description Usage Arguments Value Examples
View source: R/get_state_dat.R
Get aggregated state-level data from covidtracking.com
1 | get_state_dat(absent_negs = "remove", agg_interval = NULL, t0 = "2020-03-01")
|
absent_negs |
A character vector controlling what is done with rows in which negative case counts
aren't reported. This must be one of the strings |
agg_interval |
A positive whole number giving the desired length of aggregation intervals. |
t0 |
A date in the format "mm-dd-yyyy" which will serve as the "anchor" time from which we aggregate forwards |
A data frame grouped by state. Contains aggregated counts of positive tests, negative tests, death, and hospitalizations.
If the default argument "remove" of absent_negs is chosen, rows without negative incidence data in a given state are removed, along with the first
row in which negative cases ARE reported (because we don't know if this represents a "catchup" count or not). If the argument
"collapse" is chosen, the sum of the positive cases over those dates is added to the number of positive cases in the next date which does contain negative incidence.
1 2 3 | dat <- get_state_dat(absent_negs = "remove", agg_interval = 7, t0 = "2020-03-15")
## or ##
dat <- get_state_dat(absent_negs = "collapse", agg_interval = 7, t0 = "2020-03-15")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.