Learn R Programming

cdcfluview (version 0.5.1)

get_flu_data: Retrieves state, regional or national influenza statistics from the CDC

Description

Uses the data source from the CDC FluView and provides flu reporting data as either a single data frame or a list of data frames (depending on whether either WHO NREVSS or ILINet (or both) is chosen.

Usage

get_flu_data(region = "hhs", sub_region = 1:10, data_source = "ilinet",
  years = as.numeric(format(Sys.Date(), "%Y")))

Arguments

region

one of "hhs", "census", "national"

sub_region

depends on the region_type. For "national", the sub_region should be NA. For "hhs", should be a vector between 1:10. For "census", should be a vector between 1:9

data_source

either of "who" (for WHO NREVSS) or "ilinet" or "all" (for both)

years

a vector of years to retrieve data for (i.e. 2014 for CDC flu season 2014-2015). Default value is the current year and all years values should be > 1997

Value

If only a single data_source is specified, then a single data.frame is returned, otherwise a named list with each data.frame is returned.

Details

A lookup table between HHS regions and their member states/territories is provided in hhs_regions.

Examples

Run this code
# NOT RUN {
flu <- get_flu_data("hhs", 1:10, c("who", "ilinet"), years=2000:2014)
# }

Run the code above in your browser using DataLab