You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 for the USA at various geographical resolutions, both from official government sources such as the [Center for Disease Control (CDC)](https://www.cdc.gov/datastatistics/index.html) and [Google Trends](https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/google-symptoms.html) and private partners such as [Facebook](https://delphi.cmu.edu/blog/2020/08/26/covid-19-symptom-surveys-through-facebook/) and [Change Healthcare](https://www.changehealthcare.com/). It is built and maintained by the Carnegie Mellon University [Delphi research group](https://delphi.cmu.edu/).
28
+
29
+
This package is designed to streamline the downloading and usage of data from the [Delphi Epidata
30
+
API](https://cmu-delphi.github.io/delphi-epidata/). 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)).
31
+
32
+
## Usage
33
+
34
+
```{r}
35
+
library(epidatr)
36
+
# Obtain the smoothed covid-like illness (CLI) signal from the
37
+
# Facebook survey as it was on April 10, 2021 for the US
38
+
epidata <- pub_covidcast(
39
+
source = "fb-survey",
40
+
signals = "smoothed_cli",
41
+
geo_type = "nation",
42
+
time_type = "day",
43
+
geo_values = "us",
44
+
time_values = epirange(20210101, 20210601),
45
+
as_of = "2021-06-01"
46
+
)
47
+
epidata
48
+
```
49
+
50
+
```{r fb-cli-signal}
51
+
# Plot this data
52
+
library(ggplot2)
53
+
ggplot(epidata, aes(x = time_value, y = value)) +
54
+
geom_line() +
55
+
labs(
56
+
title = "Smoothed CLI from Facebook Survey",
57
+
subtitle = "US, 2021",
58
+
x = "Date",
59
+
y = "CLI"
60
+
)
61
+
```
62
+
63
+
64
+
## Installation
65
+
66
+
Install from GitHub:
67
+
68
+
```R
69
+
# Install the dev version using `pak` or `remotes`
70
+
pak::pkg_install("cmu-delphi/epidatr")
71
+
remotes::install_github("cmu-delphi/epidatr")
72
+
```
73
+
74
+
CRAN version coming soon.
75
+
76
+
### API Keys
77
+
78
+
The Delphi API requires a (free) API key for full functionality. To generate
79
+
your key, register for a pseudo-anonymous account
80
+
[here](https://api.delphi.cmu.edu/epidata/admin/registration_form) and see more
81
+
discussion on the [general API
82
+
website](https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html). The
83
+
`epidatr` client will automatically look for this key in the R option
84
+
`delphi.epidata.key` or in the environment variable
85
+
`DELPHI_EPIDATA_KEY`. We recommend storing your key in `.Renviron` file, which R
86
+
will read by default.
87
+
88
+
Note that for the time being, the private endpoints (i.e. those prefixed with
89
+
`pvt`) will require a separate key that needs to be passed as an argument.
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.
99
+
100
+
## For users of the `covidcast` R package
101
+
102
+
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. The `covidcast` package is deprecated and will no longer be updated.
<!-- README.md is generated from README.Rmd. Please edit that file -->
5
3
6
-
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 for the USA at various geographical resolutions, both from official government sources such as the [Center for Disease Control (CDC)](https://www.cdc.gov/datastatistics/index.html) and [Google Trends](https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/google-symptoms.html) and private partners such as [Facebook](https://delphi.cmu.edu/blog/2020/08/26/covid-19-symptom-surveys-through-facebook/) and [Change Healthcare](https://www.changehealthcare.com/). It is built and maintained by the Carnegie Mellon University [Delphi research group](https://delphi.cmu.edu/).
4
+
# Delphi Epidata R client
7
5
8
-
This package is designed to streamline the downloading and usage of data from the [Delphi Epidata
9
-
API](https://cmu-delphi.github.io/delphi-epidata/). 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)).
Note that for the time being, the private endpoints (i.e. those prefixed
113
+
with `pvt`) will require a separate key that needs to be passed as an
114
+
argument.
88
115
89
116
## Get updates
90
117
91
-
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.
118
+
You should consider subscribing to the [API mailing
to be notified of package updates, new data sources, corrections, and
121
+
other updates.
92
122
93
123
## For users of the `covidcast` R package
94
124
95
-
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. The `covidcast` package is deprecated and will no longer be updated.
125
+
The `epidatr` package is a complete rewrite of the [`covidcast`
126
+
package](https://cmu-delphi.github.io/covidcast/covidcastR/), with a
127
+
focus on speed, reliability, and ease of use. The `covidcast` package is
0 commit comments