get_state_dat: Get aggregated state-level data from covidtracking.com

Description Usage Arguments Value Examples

View source: R/get_state_dat.R

Description

Get aggregated state-level data from covidtracking.com

Usage

1
get_state_dat(absent_negs = "remove", agg_interval = NULL, t0 = "2020-03-01")

Arguments

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 "remove" (default) or "collapse".

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

Value

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.

Examples

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")

klumbard/covidWeekly documentation built on May 18, 2020, 4:15 a.m.