epidatr

Delphi Epidata API R Client

https://github.com/cmu-delphi/epidatr

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Delphi Epidata API R Client

Basic Info
Statistics
  • Stars: 5
  • Watchers: 14
  • Forks: 5
  • Open Issues: 53
  • Releases: 3
Created almost 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License Codeowners

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
ggplot2::theme_set(ggplot2::theme_bw())
```

# Delphi Epidata R client


[![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url]
[![codecov](https://codecov.io/gh/dsweber2/epidatr/branch/dev/graph/badge.svg?token=jVHL9eHZNZ)](https://app.codecov.io/gh/dsweber2/epidatr)


The [Delphi Epidata API](https://cmu-delphi.github.io/delphi-epidata/) provides
real-time access to epidemiological surveillance data for influenza, COVID-19,
and other diseases from both official government sources such as the [Centers
for Disease Control and Prevention
(CDC)](https://www.cdc.gov/), private partners such as
[Facebook (now
Meta)](https://delphi.cmu.edu/blog/2020/08/26/covid-19-symptom-surveys-through-facebook/)
and [Change Healthcare](https://www.changehealthcare.com/), and other public
datasets like [Google
Trends](https://console.cloud.google.com/marketplace/product/bigquery-public-datasets/covid19-search-trends).
It is built and maintained by the Carnegie Mellon University [Delphi Research
Group](https://delphi.cmu.edu/).

This package is designed to streamline the downloading and usage of data from
the Delphi Epidata API. It provides a simple R interface to the API, including
functions for downloading data, parsing the results, and converting the data
into a tidy format. The API stores a historical record of all data, including
corrections and updates, which is particularly useful for accurately backtesting
forecasting models. We also provide packages for downstream data processing
([epiprocess](https://github.com/cmu-delphi/epiprocess)) and modeling
([epipredict](https://github.com/cmu-delphi/epipredict)).

## Usage

```{r, echo=FALSE}
# This is so that if you have USE_EPIDATR_CACHE=TRUE in your .Renviron, the
# startup message does not get included in the README.md when you build this.
suppressPackageStartupMessages(library(epidatr))
```

```{r}
library(epidatr)
# Obtain the smoothed covid-like illness (CLI) signal from Delphi's US COVID-19
# Trends and Impact Survey (CTIS), in partnership with Facebook, as it was on
# April 10, 2021 for the US at the national level
epidata <- pub_covidcast(
  source = "fb-survey",
  signals = "smoothed_cli",
  geo_type = "nation",
  time_type = "day",
  geo_values = "us",
  time_values = epirange(20210101, 20210601),
  as_of = 20210601
)
epidata
```

## Installation

Installing the package is straightforward.

```R
# Install the CRAN version
pak::pkg_install("epidatr")
# Install the development version from the GitHub dev branch
pak::pkg_install("cmu-delphi/epidatr@dev")
```

Our CRAN listing is [here](https://CRAN.R-project.org/package=epidatr/index.html).

### API Keys

The Delphi API requires a (free) API key for full functionality. To generate
your key, register for a pseudo-anonymous account
[here](https://api.delphi.cmu.edu/epidata/admin/registration_form) and see more
discussion on the [general API
website](https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html). The
`epidatr` client will automatically look for this key in the environment
variable `DELPHI_EPIDATA_KEY`. We recommend storing your key in your `.Renviron`
file, which R will read by default.

Note that for the time being, the private endpoints (i.e. those prefixed with
`pvt`) will require a separate key that needs to be passed as an argument.

## For users of the covidcast R package

The `covidcast` package is deprecated and will no longer be updated. The
`epidatr` package is a complete rewrite of the [`covidcast`
package](https://cmu-delphi.github.io/covidcast/covidcastR/), with a focus on
speed, reliability, and ease of use. It also supports more endpoints and data
sources than `covidcast`. When migrating from that package, you will need to use
the
[`pub_covidcast`](https://cmu-delphi.github.io/epidatr/reference/pub_covidcast.html)
function in `epidatr`.

## Get updates

**You should consider subscribing to the [API mailing list](https://lists.andrew.cmu.edu/mailman/listinfo/delphi-covidcast-api)** to be notified of package updates, new data sources, corrections, and other updates.

## Usage terms and citation

We request that if you use the `epidatr` package in your work, or use any of the data provided by the Delphi Epidata API through non-`covidcast` endpoints, that you cite us using the citation given by [`citation("epidatr")`](https://cmu-delphi.github.io/epidatr/dev/authors.html#citation). If you use any of the data from the `covidcast` endpoint, please use the [COVIDcast citation](https://cmu-delphi.github.io/covidcast/covidcastR/authors.html#citation) as well. See the [COVIDcast licensing documentation](https://cmu-delphi.github.io/delphi-epidata/api/covidcast_licensing.html) and the [licensing documentation for other endpoints](https://cmu-delphi.github.io/delphi-epidata/api/README.html#data-licensing) for information about citing the datasets provided by the API.

**Warning:** If you use data from the Epidata 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 [Terms of Use](https://delphi.cmu.edu/covidcast/terms-of-use/), noting that the data is a research product and not warranted for a particular purpose.


[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
[mit-url]: https://opensource.org/license/mit
[github-actions-image]: https://github.com/cmu-delphi/epidatr/workflows/ci/badge.svg
[github-actions-url]: https://github.com/cmu-delphi/epidatr/actions

Owner

  • Name: Delphi
  • Login: cmu-delphi
  • Kind: organization
  • Location: Carnegie Mellon University

Developing the Theory and Practice of Epidemiological Forecasting

GitHub Events

Total
  • Create event: 9
  • Release event: 2
  • Issues event: 17
  • Watch event: 3
  • Delete event: 7
  • Issue comment event: 26
  • Push event: 49
  • Pull request review event: 23
  • Pull request review comment event: 13
  • Pull request event: 21
Last Year
  • Create event: 9
  • Release event: 2
  • Issues event: 17
  • Watch event: 3
  • Delete event: 7
  • Issue comment event: 26
  • Push event: 49
  • Pull request review event: 23
  • Pull request review comment event: 13
  • Pull request event: 21

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 11
  • Total pull requests: 5
  • Average time to close issues: 1 day
  • Average time to close pull requests: 7 minutes
  • Total issue authors: 4
  • Total pull request authors: 2
  • Average comments per issue: 0.36
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 11
  • Pull requests: 5
  • Average time to close issues: 1 day
  • Average time to close pull requests: 7 minutes
  • Issue authors: 4
  • Pull request authors: 2
  • Average comments per issue: 0.36
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • nmdefries (11)
  • dsweber2 (8)
  • dshemetov (7)
  • brookslogan (5)
  • tinatownes (3)
  • pcollender (2)
  • dajmcdon (1)
Pull Request Authors
  • dsweber2 (16)
  • dshemetov (16)
  • nmdefries (9)
  • dajmcdon (2)
  • tinatownes (1)
Top Labels
Issue Labels
enhancement (2) bug (1) P2 (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 657 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 5
  • Total maintainers: 1
cran.r-project.org: epidatr

Client for Delphi's 'Epidata' API

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 657 Last month
Rankings
Forks count: 10.8%
Dependent repos count: 23.8%
Dependent packages count: 28.6%
Stargazers count: 30.8%
Average: 34.9%
Downloads: 80.3%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • MMWRweek * imports
  • httr * imports
  • jsonlite * imports
  • readr * imports
  • rlang * imports
  • knitr * suggests
  • magrittr * suggests
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/ci.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact master composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/create_release.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peter-evans/create-pull-request v3 composite
.github/workflows/release_helper.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peter-evans/create-pull-request v3 composite
  • release-drafter/release-drafter v5 composite