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 endpoint's fetch_classic output has been modified to just
names, since the full output is too long
Secrets moved to the .Reviron file.
Duplicate copy of Google Health Trends removed
various references fixed
Copy file name to clipboardExpand all lines: vignettes/endpoints.Rmd
+38-43
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
---
2
-
title: "COVIDcast API Client"
2
+
title: "Endpoint Examples"
3
3
author: "Delphi Group"
4
4
date: "`r Sys.Date()`"
5
5
output: rmarkdown::html_vignette
6
6
vignette: >
7
-
%\VignetteIndexEntry{COVIDcast API Client}
7
+
%\VignetteIndexEntry{Endpoint Examples}
8
8
%\VignetteEngine{knitr::rmarkdown}
9
9
\usepackage[utf8]{inputenc}
10
10
---
@@ -23,6 +23,7 @@ library("dplyr")
23
23
```
24
24
25
25
The API endpoints, organized by data sources.
26
+
Some endpoints allow for the use of `*` to access data at all locations. Check the help for a given endpoint to see if it supports `*`.
26
27
27
28
## COVIDcast Main Endpoint
28
29
@@ -59,6 +60,17 @@ covidcast(
59
60
) %>% fetch_tbl()
60
61
```
61
62
County geo_values are [FIPS codes](https://en.wikipedia.org/wiki/List_of_United_States_FIPS_codes_by_county) and are discussed more here: <https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html>. The example above is for Orange County, California.
63
+
Since `covidcast` is an endpoint which supports `*`, here is an example of its use:
64
+
```{r}
65
+
covidcast(
66
+
data_source = "fb-survey",
67
+
signals = "smoothed_accept_covid_vaccine",
68
+
geo_type = "county",
69
+
time_type = "day",
70
+
time_values = epirange(20201221, 20201225),
71
+
geo_values = "*"
72
+
) %>% fetch_tbl()
73
+
```
62
74
63
75
## Other Covid Endpoints
64
76
@@ -121,10 +133,10 @@ Function reference: <https://cmu-delphi.github.io/epidatr/reference/delphi.html>
These require private access keys to use. To actually run these locally, if you have stored these secrets in `secrets.R` in the root directory of this project, first run
256
-
```{r, eval=FALSE}
257
-
source("../secrets.R")
258
-
```
259
-
Each source has it's own auth that it needs, which is the first argument.
264
+
These require private access keys to use. To actually run these locally, you will need to store these secrets in your `.Reviron` file, or set them as environmental variables.
260
265
261
266
### AFHSB metadata
262
267
263
-
API docs: <https://cmu-delphi.github.io/delphi-epidata/api/ght.html>
268
+
API docs: <https://cmu-delphi.github.io/delphi-epidata/api/meta_afhsb.html>
264
269
265
-
Function reference: <https://cmu-delphi.github.io/epidatr/reference/pvt_ght.html>
270
+
Function reference: <https://cmu-delphi.github.io/epidatr/reference/pvt_meta_afhsb.html>
pvt_ght(auth = Sys.getenv("SECRET_API_AUTH_GHT"), epiweeks = epirange(199301, 202304), locations = "ma", query = "how to get over the flu") %>% fetch_tbl()
331
326
```
332
327
333
328
### NoroSTAT metadata
@@ -338,18 +333,18 @@ Function reference: <https://cmu-delphi.github.io/epidatr/reference/pvt_meta_nor
0 commit comments