@@ -8,39 +8,39 @@ nav_order: 1
88
99For anyone looking for COVIDCast data, please visit our [ COVIDCast Libraries] ( covidcast_clients.md ) .
1010
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 ) .
1314
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 ) .
1618
1719In the meantime, minimalist Epidata clients remain available for
18- [ JavaScript] ( https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js ) ,
1920[ 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 ) ,
2022and
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 ) .
2224The 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
2426` 20200401 ` and ` 20200405-20200414 ` (11 days total).
2527
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
2929
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 )
3940````
4041
4142### Python
4243
43-
4444Optionally install the [ package from PyPI] ( https://pypi.org/project/delphi-epidata/ ) using pip(env):
4545```` bash
4646pip install delphi-epidata
@@ -60,15 +60,29 @@ res = Epidata.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401,
6060print (res[' result' ], res[' message' ], len (res[' epidata' ]))
6161````
6262
63- ### R
63+ ### JavaScript (in a web browser)
6464
65+ The minimalist JavaScript client does not currently support API keys. If you need API key support in JavaScript, contact
[email protected] .
6566
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
6781# [Optional] configure your API key, if desired
6882# option('epidata.auth', <your API key>)
6983# Import
7084source(' delphi_epidata.R' )
7185# Fetch data
7286res <- Epidata $ covidcast(' fb-survey' , ' smoothed_cli' , ' day' , ' county' , list (20200401 , Epidata $ range(20200405 , 20200414 )), ' 06001' )
7387cat(paste(res $ result , res $ message , length(res $ epidata ), " \n " ))
74- ````
88+ ```
0 commit comments