load_covidcast_data: Assemble a data frame of incident hospitalizations due to...

View source: R/load_covidcast_data.R

load_covidcast_dataR Documentation

Assemble a data frame of incident hospitalizations due to COVID-19 as they were available as of a specified issue date in COVIDcast.

Description

Assemble a data frame of incident hospitalizations due to COVID-19 as they were available as of a specified issue date in COVIDcast.

Usage

load_covidcast_data(
  issue_date = NULL,
  as_of = NULL,
  location_code = NULL,
  spatial_resolution = NULL,
  temporal_resolution = "weekly",
  measure = "hospitalizations",
  geography = "US",
  drop_last_date = FALSE
)

Arguments

issue_date

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

as_of

character as_of 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'

spatial_resolution

character vector specifying spatial unit types to include: 'state', 'national' and/or 'county'. It has to match with locations in location_code. Default to NULL, all available spatial resolution based on the given measure. Note that 'county' is not available for hospitalization measure.

temporal_resolution

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

measure

character vector specifying measure of covid prevalence: must be one of 'hospitalizations', 'deaths' or 'cases'.

geography

character, which data to read. Default is "US". Note this variable is not used in the function

drop_last_date

boolean indicating whether to drop the last 1 day of data for the influenza and COVID hospitalization signals. The last day of data from the HHS data source is unreliable, so it is recommended to set this to TRUE. However, the default is FALSE so that the function maintains fidelity to the authoritative data source. This argument is ignored if the measure is 'deaths' or 'cases'.

Value

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


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