get_hosp_data.RdUses the data source from the CDC FluView and provides influenza hospitalization reporting data as a data frame.
get_hosp_data(area = "flusurvnet", age_group = "overall", years = as.numeric(format(Sys.Date(), "%Y")) - 1)
| area | one of " |
|---|---|
| age_group | a vector of age groups to pull data for. Possible values are:
" |
| years | a vector of years to retrieve data for (i.e. |
A single data.frame.
There is often a noticeable delay when making the API request to the CDC.
This is not due to a large download size, but the time it takes for their
servers to crunch the data. Wrap the function call in httr::with_verbose
if you would like to see what's going on.
# NOT RUN { # All of FluSurv-NET, 50-64 years old, 2010/11-2014/15 flu seasons hosp <- get_hosp_data("flusurvnet", "50-64y", years=2010:2014) # }