covidcast: Access Delphi's COVID-19 Surveillance Streams Data

View source: R/api.R

covidcastR Documentation

Access Delphi's COVID-19 Surveillance Streams Data

Description

covidcast provides an interface to the API documented at https://cmu-delphi.github.io/delphi-epidata/api/covidcast.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

covidcast(
  source = c("covidcast", "covidcast_meta"),
  data_source = c("doctor-visits", "fb-survey", "ght", "google-survey",
    "indicator-combination", "jhu-csse", "quidel", "youtube-survey"),
  signal = c("smoothed_adj_cli", "smoothed_cli", "raw_cli", "raw_hh_cmnty_cli",
    "raw_ili", "raw_nohh_cmnty_cli", "raw_wcli", "raw_wili", "smoothed_hh_cmnty_cli",
    "smoothed_ili", "smoothed_nohh_cmnty_cli", "smoothed_wcli", "smoothed_wili",
    "raw_search", "smoothed_search", "nmf_day_doc_fbs_ght", "confirmed_cumulative_num",
    "confirmed_incidence_num", "confirmed_incidence_prop", "deaths_cumulative_num",
    "deaths_incidence_num", "deaths_incidence_prop", "raw_pct_negative",
    "raw_tests_per_device", "smoothed_pct_negative",      "smoothed_tests_per_device"),
  time_type = "day",
  time_values = "20200415",
  geo_type = c("state", "county", "msa", "hrr", "dma"),
  geo_value = c("NY"),
  query = NULL
)

Arguments

source

String specifying whether to request data or metadata.

data_source

String specifying data stream.

signal

String specifying specific time series from data stream.

time_type

String specifying time unit.

time_values

String specifying time value of data. Dates must be in the form YYYYMMDD. Use two time values separated by "-" to obtain data from a range of time values. Request data from multiple time values by concatenating them using "," as a separator.

geo_type

String specifying type of geographic unit.

geo_value

String specifying geographic value of data. * for all available. See API documentation for valid identifiers.

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

covidcast(source="covidcast_meta")
covidcast(data_source = "fb-survey", signal = "raw_cli",
  geo_type = "county", time_value = "20200401,20200405-20200414",
  geo_value = "06001")

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