Learn R Programming

covidcast R package

Provides R access to the COVIDcast Epidata API published by the Delphi group at Carnegie Mellon University. This API provides daily access to a range of COVID-related signals Delphi that builds and maintains, from sources like symptom surveys and medical claims data, and also standard signals that we simply mirror, like confirmed cases and deaths.

Fetching data in a data frame is as easy selecting the signal you want and then using covidcast_signal():

library(covidcast)

deaths <- covidcast_signal("jhu-csse", "deaths_incidence_num",
                           "2020-04-15", "2021-04-15",
                           geo_type = "nation")
plot(deaths, plot_type = "line")

The package supports convenient plotting and mapping tools, correlation analyses between signals, and various geographic utilities for working with counties, metropolitan areas, and other units.

Consult the COVIDcast Epidata API documentation for details on the data included in the API, licensing, and how to cite this data in your work. The signals documentation lists all the data sources and signals available through this API.

To get started using this package, view the Getting Started guide at vignette("covidcast").

Get updates

You should consider subscribing to the API mailing list to be notified of package updates, new data sources, corrections, and other updates.

Usage terms and citation

We request that if you use the covidcast package in your work, or use any of the data provided by the COVIDcast Epidata API, that you cite us using the citations given by citation("covidcast"). See the COVIDcast Epidata licensing documentation for information about citing the datasets provided by the API.

Warning: If you use data from the COVIDcast API to power a product, dashboard, app, or other service, please download the data you need and store it centrally rather than making API requests for every user. Our server resources are limited and cannot support high-volume interactive use.

See also the COVIDcast Terms of Use, noting that the data is a research product and not warranted for a particular purpose.

Copy Link

Version

Install

install.packages('covidcast')

Monthly Downloads

367

Version

0.5.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Alex Reinhart

Last Published

July 12th, 2023

Functions in covidcast (0.5.2)

abbr_to_fips

Get FIPS codes from state abbreviations
abbr_to_name

Get state names from state abbreviations
covidcast_signals

Obtain multiple COVIDcast signals at once
fips_to_abbr

Get state abbreviations from FIPS codes
state_fips_to_name

Get state, county or metropolitan area names from FIPS or CBSA codes
summary.covidcast_meta

Summarize covidcast_meta object
covidcast_cor

Compute correlations between two covidcast_signal data frames
aggregate_signals

Aggregate covidcast_signal objects into one data frame
as.covidcast_signal

Convert data from an external source into a form compatible with covidcast_signal.
covidcast_longer

Pivot aggregated signals between "wide" and "long" formats
latest_issue

Fetch the latest or earliest issue for each observation
msa_census

Metro area population data
name_to_fips

Get FIPS or CBSA codes from county or metropolitan area names
name_to_abbr

Get state abbreviations from state names
print.covidcast_signal

Print covidcast_signal object
county_census

County census population data
covidcast-package

covidcast: Client for Delphi's COVIDcast API
state_census

State population data
summary.covidcast_signal

Summarize covidcast_signal object
covidcast_signal

Obtain a data frame for one COVIDcast signal
covidcast_meta

Obtain COVIDcast metadata
plot.covidcast_signal

Plot covidcast_signal object as choropleths, bubbles, or time series
print.covidcast_meta

Print covidcast_meta object