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
Copy file name to clipboardExpand all lines: vignettes/epidatr.Rmd
+21-5Lines changed: 21 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -62,17 +62,33 @@ Examples queries with all the endpoint functions available in this package are g
62
62
63
63
## Advanced Usage (Experimental)
64
64
65
-
You can use `covidcast_epidata` to get help with finding sources and functions without leaving R.
66
-
Using tab completion after typing `epidata$signals$` below, you can see all the available sources and signals in the API, with the format `source:signal`.
67
-
Note that some signal names have dashes in them, so to access them we rely on the backtick operator.
65
+
The [COVIDcast
66
+
endpoint](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html) of the
67
+
Epidata API contains many separate data sources and signals. It can be difficult
68
+
to find the name of the signal you're looking for, so you can use
69
+
`covidcast_epidata` to get help with finding sources and functions without
70
+
leaving R.
71
+
72
+
The `covidcast_epidata()` function fetches a list of all signals, and returns an
73
+
object containing fields for every signal:
68
74
69
75
```{r}
70
-
epidata <- epidatr:::covidcast_epidata()
76
+
epidata <- covidcast_epidata()
71
77
epidata$signals
78
+
```
79
+
80
+
If you use an editor that supports tab completion, such as RStudio, type
81
+
`epidata$signals$` and wait for the tab completion popup. You will be able to
82
+
type the name of signals and have the autocomplete feature select them from the
83
+
list for you. Note that some signal names have dashes in them, so to access them
84
+
we rely on the backtick operator:
85
+
86
+
```{r}
72
87
epidata$signals$`fb-survey:smoothed_cli`
73
88
```
74
89
75
-
From there, you can construct a call analogous to the one above, but using the API object instead of the functions directly.
90
+
These objects can be used directly to fetch data, without requiring us to use
91
+
the `covidcast()` function. Simple use the `$call` attribute of the object:
0 commit comments