fluview: Access Delphi's collection of CDC FluView Data

View source: R/api.R

fluviewR Documentation

Access Delphi's collection of CDC FluView Data

Description

fluview provides an interface to the API documented at https://cmu-delphi.github.io/delphi-epidata/api/fluview.html. There is a simple R script available in the delphi-epidata git repository which also can be used to access the API in R.

Usage

fluview(
  epiweeks = "202016",
  regions = "flusight_state",
  lag = 0,
  issues = NULL,
  query = NULL
)

Arguments

epiweeks

String specifying epiweeks for which to request data. Epiweeks must be in the form YYYYUU. Use two epiweeks separated by "-" to obtain data from a range of time values. Request data from multiple time values by concatenating them using "," as a separator.

regions

String specifying regions for which to request data. Regions identifiers must be those used by the API or flusight_state or flusight which gives sets of regions that are included in those competitions.

lag

String specifying the number of weeks after the requested epiweek to use as the issue week. The issue week is the week at which the data are considered up-to-date. In other words, all revisions of the data up to that week are applied.

issues

String specifying the issues of the data to request. The formating is the same is epiweeks. This parameter is an alternative to lag, and overides it if present. issue = lag + epiweek.

query

String with query for API that overides other arguments if provided.

Value

An S3 object which is simply a list which has its own print method. The list's elements are:

epidata

a data frame with rows containing elements of the epidata list returned from the API

url

the URL used in the API request

response

the full response.

Examples

fluview(regions = "nat")
fluview(regions = "jfk", epiweeks = "202015", lag=1)
fluview(regions = "jfk", epiweeks = "202015", issues = "202016")

e3bo/epidatr documentation built on Oct. 19, 2023, 12:37 a.m.