API docs: https://cmu-delphi.github.io/delphi-epidata/api/covid_hosp.html.
Obtains the COVID-19 reported patient impact and hospital capacity data by state. This dataset is provided by the US Department of Health & Human Services.
Usage
pub_covid_hosp_state_timeseries(
states,
dates = "*",
...,
as_of = NULL,
issues = NULL,
fetch_args = fetch_args_list()
)Arguments
- states
character. List of states to fetch, formatted as two letter state abbreviations.
- dates
timeset. Dates to fetch. Supportsepirange()and defaults to all ("*") dates.- ...
not used for values, forces later arguments to bind by name
- as_of
Date. Optionally, the as-of date for the issues to fetch. See the "Data Versioning" section for details.
- issues
timeset. Optionally, the issue(s) of the data to fetch. See the "Data Versioning" section for details.- fetch_args
fetch_args. Additional arguments to pass tofetch(). Seefetch_args_list()for details.
Data Versioning
Several endpoints support retrieving historical versions of the data. The following parameters control this and are mutually exclusive (only one can be provided at a time).
as_of: (Date) Retrieve the data as it was on this date.issues:timesetRetrieve data from a specific issue date or range of dates.lag: (integer) Retrieve data with a specific lag from its issue date.
If none of these is specified, the most recent version of the data is returned.
See vignette("versioned-data") for details and more ways to specify
versioned data.
Examples
pub_covid_hosp_state_timeseries(
states = "fl",
dates = epirange(20200101, 20200501)
)
#> # A tibble: 51 × 118
#> state geocoded_state issue date critical_staffing_shortage_today…¹
#> <chr> <lgl> <date> <date> <lgl>
#> 1 FL NA 2024-05-03 2020-03-12 FALSE
#> 2 FL NA 2024-05-03 2020-03-13 FALSE
#> 3 FL NA 2024-05-03 2020-03-14 FALSE
#> 4 FL NA 2024-05-03 2020-03-15 FALSE
#> 5 FL NA 2024-05-03 2020-03-16 FALSE
#> 6 FL NA 2024-05-03 2020-03-17 FALSE
#> 7 FL NA 2024-05-03 2020-03-18 FALSE
#> 8 FL NA 2024-05-03 2020-03-19 FALSE
#> 9 FL NA 2024-05-03 2020-03-20 FALSE
#> 10 FL NA 2024-05-03 2020-03-21 FALSE
#> # ℹ 41 more rows
#> # ℹ abbreviated name: ¹critical_staffing_shortage_today_yes
#> # ℹ 113 more variables: critical_staffing_shortage_today_no <lgl>,
#> # critical_staffing_shortage_today_not_reported <lgl>,
#> # critical_staffing_shortage_anticipated_within_week_yes <lgl>,
#> # critical_staffing_shortage_anticipated_within_week_no <lgl>,
#> # critical_staffing_shortage_anticipated_within_week_not_reported <lgl>, …