load_jhu_data: Assemble a data frame of incident and cumulative deaths or...

View source: R/jhu_data.R

load_jhu_dataR Documentation

Assemble a data frame of incident and cumulative deaths or cases due to COVID-19 as they were available as of a specified issue date.

Description

Assemble a data frame of incident and cumulative deaths or cases due to COVID-19 as they were available as of a specified issue date.

Usage

load_jhu_data(
  issue_date = NULL,
  as_of = NULL,
  location_code = NULL,
  spatial_resolution = "state",
  temporal_resolution = "weekly",
  measure = "deaths",
  geography = c("US", "global"),
  replace_negatives = FALSE,
  adjustment_cases = "none",
  adjustment_method = "none",
  ...
)

Arguments

issue_date

character issue date (i.e. report date) to use for constructing truths in format 'yyyy-mm-dd'

location_code

character vector of location codes. Default to NULL. For US locations, this should be a list of FIPS code or 'US' For ECDC locations, this should be a list of location name abbreviation.

spatial_resolution

character vector specifying spatial unit types to include: 'county', 'state' and/or 'national'. This parameter will be ignored if location_code is provided or geography is "global".

temporal_resolution

character vector specifying temporal resolution to include: 'daily' or 'weekly'

measure

character vector specifying measure of covid prevalence: 'deaths' or 'cases'

geography

character, which data to read. Default is "US", other option is "global"

replace_negatives

boolean to replace negative incs with imputed data

adjustment_cases

character vector specifying times and locations with reporting anomalies to adjust. Either 'none' (the default) or one or more of 'CO-2020-04-24', 'MS-2020-06-22', 'DE-2020-06-23', 'NJ-2020-06-25'. These refer to locations and times affected by reporting anomalies documented at https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data#user-content-retrospective-reporting-of-probable-cases-and-deaths

adjustment_method

string specifying how anomalies are adjusted. 'fill_na' will replace affected observations with NAs and correct daily cumulative counts for all dates on and after adjustment date. 'impute_and_redistribute' will replace affected observations with imputed values. Difference between the original observation and the imputed value will be redistributed to observations before and on the adjustment date.

...

ignored

Value

data frame with columns location (fips code), date, inc, and cum


reichlab/covidData documentation built on April 5, 2024, 5 p.m.