Description Usage Arguments Value Note Examples
View source: R/get-hosp-data.r
Uses the data source from the CDC FluView and provides influenza hospitalization reporting data as a data frame.
1 2 3 4 5 | 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.
1 2 3 4 5 | ## 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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.