@@ -8,39 +8,39 @@ nav_order: 1
8
8
9
9
For anyone looking for COVIDCast data, please visit our [ COVIDCast Libraries] ( covidcast_clients.md ) .
10
10
11
- We are currently working on fully-featured Epidata clients for R and Python. They are not ready
12
- for release yet, but you can track our development progress and help us test them out at:
11
+ A full-featured Epidata client for R is available at
12
+ [ epidatr] ( https://github.com/cmu-delphi/epidatr ) and
13
+ [ also on CRAN] ( https://cran.r-project.org/web/packages/epidatr/index.html ) .
13
14
14
- * [ epidatr] ( https://github.com/cmu-delphi/epidatr )
15
- * [ epidatpy] ( https://github.com/cmu-delphi/epidatpy )
15
+ We are currently working on a new full-featured Epidata client for Python. It is not ready
16
+ for release yet, but you can track our development progress and help us test it out at
17
+ [ epidatpy] ( https://github.com/cmu-delphi/epidatpy ) .
16
18
17
19
In the meantime, minimalist Epidata clients remain available for
18
- [ JavaScript] ( https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js ) ,
19
20
[ Python] ( https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.py ) ,
21
+ [ JavaScript] ( https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js ) ,
20
22
and
21
- [ R] ( https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.R ) .
23
+ [ R (legacy) ] ( https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.R ) .
22
24
The following samples show how to import the library and fetch Delphi's COVID-19
23
- Surveillance Streams from Facebook Survey CLI for county 06001 and days
25
+ Surveillance Streams from Facebook Survey CLI for county 06001, and days
24
26
` 20200401 ` and ` 20200405-20200414 ` (11 days total).
25
27
26
- ### JavaScript (in a web browser)
27
-
28
- The minimalist JavaScript client does not currently support API keys. If you need API key support in JavaScript, contact
[email protected] .
28
+ ### R
29
29
30
- ```` html
31
- <!-- Imports -->
32
- <script src =" delphi_epidata.js" ></script >
33
- <!-- Fetch data -->
34
- <script >
35
- EpidataAsync .covidcast (' fb-survey' , ' smoothed_cli' , ' day' , ' county' , [20200401 , EpidataAsync .range (20200405 , 20200414 )], ' 06001' ).then ((res ) => {
36
- console .log (res .result , res .message , res .epidata != null ? res .epidata .length : 0 );
37
- });
38
- </script >
30
+ ```` R
31
+ # [Optional] configure your API key, if desired
32
+ # Interactive. See https://cmu-delphi.github.io/epidatr/articles/epidatr.html#api-keys for details.
33
+ # save_api_key()
34
+ # Import
35
+ library(epidatr )
36
+ # Fetch data
37
+ res <- pub_covidcast(' fb-survey' , ' smoothed_cli' , ' county' , ' day' , geo_values = ' 06001' ,
38
+ time_values = c(20200401 , 20200405 : 20200414 ))
39
+ cat(res )
39
40
````
40
41
41
42
### Python
42
43
43
-
44
44
Optionally install the [ package from PyPI] ( https://pypi.org/project/delphi-epidata/ ) using pip(env):
45
45
```` bash
46
46
pip install delphi-epidata
@@ -60,15 +60,29 @@ res = Epidata.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401,
60
60
print (res[' result' ], res[' message' ], len (res[' epidata' ]))
61
61
````
62
62
63
- ### R
63
+ ### JavaScript (in a web browser)
64
64
65
+ The minimalist JavaScript client does not currently support API keys. If you need API key support in JavaScript, contact
[email protected] .
65
66
66
- ```` R
67
+ ```` html
68
+ <!-- Imports -->
69
+ <script src =" delphi_epidata.js" ></script >
70
+ <!-- Fetch data -->
71
+ <script >
72
+ EpidataAsync .covidcast (' fb-survey' , ' smoothed_cli' , ' day' , ' county' , [20200401 , EpidataAsync .range (20200405 , 20200414 )], ' 06001' ).then ((res ) => {
73
+ console .log (res .result , res .message , res .epidata != null ? res .epidata .length : 0 );
74
+ });
75
+ </script >
76
+ ````
77
+
78
+ ### R (legacy)
79
+
80
+ ``` R
67
81
# [Optional] configure your API key, if desired
68
82
# option('epidata.auth', <your API key>)
69
83
# Import
70
84
source(' delphi_epidata.R' )
71
85
# Fetch data
72
86
res <- Epidata $ covidcast(' fb-survey' , ' smoothed_cli' , ' day' , ' county' , list (20200401 , Epidata $ range(20200405 , 20200414 )), ' 06001' )
73
87
cat(paste(res $ result , res $ message , length(res $ epidata ), " \n " ))
74
- ````
88
+ ```
0 commit comments