Skip to content

Commit 257f8cd

Browse files
committed
docs: add donttest tags around all the example calls
1 parent 1215ef8 commit 257f8cd

File tree

1 file changed

+66
-21
lines changed

1 file changed

+66
-21
lines changed

R/endpoints.R

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
#' @references API docs: https://cmu-delphi.github.io/delphi-epidata/api/afhsb.html
1212
#'
1313
#' @examples
14+
#' \donttest{
1415
#' call <- pvt_afhsb(auth = "yourkey", "fl,ca", epirange(202001, 202110), "flu1,flu2-flu1")
15-
#' # fetch_tbl(call)
16+
#' fetch_tbl(call)
17+
#' }
1618
#' @export
1719
pvt_afhsb <- function(auth, locations, epiweeks, flu_types) {
1820
check_single_string_param("auth", auth)
@@ -40,8 +42,10 @@ pvt_afhsb <- function(auth, locations, epiweeks, flu_types) {
4042
#' Fetch CDC page hits
4143
#'
4244
#' @examples
45+
#' \donttest{
4346
#' call <- pvt_cdc(auth = "yourkey", epirange(20210101, 20210201), "fl,ca")
44-
#' # fetch_tbl(call)
47+
#' fetch_tbl(call)
48+
#' }
4549
#' @param auth Character. Authentication token.
4650
#' @param epiweeks Epirange. Epiweeks to fetch in the form epirange(startweek, endweek), where
4751
#' startweek and endweek are in the form YYYYWW.
@@ -156,8 +160,10 @@ covid_hosp_facility_lookup <-
156160
#' in a variety of ways.
157161
#'
158162
#' @examples
163+
#' \donttest{
159164
#' call <- covid_hosp_facility(hospital_pks = "100075", collection_weeks = epirange(20200101, 20200501))
160165
#' fetch_tbl(call)
166+
#' }
161167
#' @param hospital_pks Character. A character string of facility unique identifiers.
162168
#' @param collection_weeks Epirange. Epiweeks to fetch, in the form epirange(startdate,enddate), where
163169
#' startdate and enddate are YYYYMMDD (string or numeric).
@@ -601,8 +607,10 @@ covid_hosp_state_timeseries <-
601607
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/covidcast_meta.html>.
602608
#'
603609
#' @examples
610+
#' \donttest{
604611
#' call_meta <- covidcast_meta()
605612
#' fetch_classic(call_meta)
613+
#' }
606614
#'
607615
#' @seealso [covidcast()]
608616
#' @export
@@ -635,6 +643,7 @@ covidcast_meta <- function() {
635643
#' Fetch covidcast data
636644
#'
637645
#' @examples
646+
#' \donttest{
638647
#' call <- covidcast(
639648
#' data_source = "jhu-csse",
640649
#' signals = "confirmed_7dav_incidence_prop",
@@ -644,6 +653,7 @@ covidcast_meta <- function() {
644653
#' geo_values = "ca,fl"
645654
#' )
646655
#' fetch_tbl(call)
656+
#' }
647657
#' @param data_source Character. A data source to query: (1) fb-survey; (2) jhu-csse; (3) google-symptoms;
648658
#' (4) doctor-visits; (5) quidel; (6) hhs. For more information about each data source,
649659
#' see <https://cmu-delphi.github.io/delphi-epidata/api/covidcast_signals.html>.
@@ -675,7 +685,8 @@ covidcast_meta <- function() {
675685
#'
676686
#' @references COVIDcast API documentation: <https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html>
677687
#'
678-
#' Documentation for all COVIDcast sources and signals: <https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals>
688+
#' Documentation for all COVIDcast sources and signals:
689+
#' <https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals>
679690
#'
680691
#' COVIDcast public dashboard: <https://delphi.cmu.edu/covidcast/>
681692
#'
@@ -757,16 +768,18 @@ covidcast <-
757768

758769
#' Fetch Delphi's forecast
759770
#'
760-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/delphi.html
761-
#'
762771
#' @examples
772+
#' \donttest{
763773
#' call <- delphi(system = "ec", epiweek = 202006)
764774
#' fetch_classic(call)
775+
#' }
765776
#' @param system Character. The system name to fetch.
766777
#' @param epiweek Epirange. The epiweek to fetch, in the form epirange(startdate,enddate), where startdate
767778
#' and enddate are of the form YYYYMMDD (string or numeric).
768779
#' @return An instance of epidata_call
769780
#'
781+
#' @references API docs: https://cmu-delphi.github.io/delphi-epidata/api/delphi.html
782+
#'
770783
#' @export
771784
delphi <- function(system, epiweek) {
772785
check_single_string_param("system", system)
@@ -786,16 +799,18 @@ delphi <- function(system, epiweek) {
786799

787800
#' Fetch Delphi's PAHO Dengue nowcast
788801
#'
789-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/dengue_nowcast.html
790-
#'
791802
#' TODO: what are valid locations here?
792803
#' @examples
804+
#' \donttest{
793805
#' call <- dengue_nowcast(locations = "?", epiweeks = epirange(201501, 202001))
794806
#' fetch_classic(call)
807+
#' }
795808
#' @param locations Character vector. The locations to fetch.
796809
#' @param epiweeks Epirange. The epiweeks to fetch, specified in the form epirange(startdate,enddate), where startdate
797810
#' and enddate are of the form YYYYMMDD (string or numeric).
798-
#' @return an instance of epidata_call
811+
#' @return An instance of epidata_call
812+
#'
813+
#' @references API docs: https://cmu-delphi.github.io/delphi-epidata/api/dengue_nowcast.html
799814
#'
800815
#' @export
801816
dengue_nowcast <- function(locations, epiweeks) {
@@ -816,18 +831,20 @@ dengue_nowcast <- function(locations, epiweeks) {
816831

817832
#' Fetch Delphi's digital surveillance sensors
818833
#'
819-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/dengue_sensors.html
820-
#'
821834
#' TODO: what are valid locations and names?
822835
#' @examples
836+
#' \donttest{
823837
#' call <- pvt_dengue_sensors(auth = "yourkey", names = "?", locations = "?", epiweeks = epirange(201501, 202001))
824-
#' # fetch_classic(call)
838+
#' fetch_classic(call)
839+
#' }
825840
#' @param auth Character. Authentication token.
826841
#' @param names Character vector. The list of names to fetch.
827842
#' @param locations Character vector. The locations to fetch.
828843
#' @param epiweeks Epirange. The epiweeks to fetch in the form epirange(startweek,endweek), where startweek
829844
#' and endweek are of the form YYYYWW (string or numeric).
830-
#' @return an instance of epidata_call
845+
#' @return An instance of epidata_call
846+
#'
847+
#' @references API docs: https://cmu-delphi.github.io/delphi-epidata/api/dengue_sensors.html
831848
#'
832849
#' @export
833850
pvt_dengue_sensors <- function(auth, names, locations, epiweeks) {
@@ -857,11 +874,14 @@ pvt_dengue_sensors <- function(auth, names, locations, epiweeks) {
857874
#'
858875
#' Obtain information on influenza-like-illness from the European Center of Disease Control.
859876
#'
860-
#' @details The list of location argument can be found in <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/ecdc_regions.txt>.
877+
#' @details The list of location argument can be found in
878+
#' <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/ecdc_regions.txt>.
861879
#'
862880
#' @examples
881+
#' \donttest{
863882
#' call <- ecdc_ili(regions = "austria", epiweeks = epirange(201201, 202001))
864883
#' fetch_classic(call)
884+
#' }
865885
#' @param regions Character vector. The regions to fetch.
866886
#' @param epiweeks Epirange. The epiweeks to fetch in the form epirange(startdate,enddate), where
867887
#' startdate and enddate are of the form YYYYWW (string or numeric).
@@ -908,11 +928,14 @@ ecdc_ili <- function(regions,
908928
#'
909929
#' Obtain information on flu hospitalization rates from the Center of Disease Control.
910930
#'
911-
#' @details The list of location argument can be found in <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/flusurv_locations.txt>.
931+
#' @details The list of location argument can be found in
932+
#' <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/flusurv_locations.txt>.
912933
#'
913934
#' @examples
935+
#' \donttest{
914936
#' call <- flusurv(locations = "CA", epiweeks = epirange(201201, 202001))
915937
#' fetch_classic(call)
938+
#' }
916939
#' @param locations Character vector. Character strings indicating location.
917940
#' @param epiweeks Epirange. The epiweeks to fetch the form epirange(startweek,endweek), where startweek
918941
#' and endweek are of the form YYYYWW (string or numeric).
@@ -1019,10 +1042,10 @@ fluview_clinical <-
10191042

10201043
#' Fetch fluview meta data
10211044
#'
1022-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/fluview_meta.html
1023-
#'
10241045
#' @return An instance of epidata_call
10251046
#'
1047+
#' @references API docs: https://cmu-delphi.github.io/delphi-epidata/api/fluview_meta.html
1048+
#'
10261049
#' @export
10271050
fluview_meta <- function() {
10281051
create_epidata_call(
@@ -1146,8 +1169,10 @@ gft <- function(locations, epiweeks) {
11461169
#'
11471170
#' TODO: find a non-trivial query
11481171
#' @examples
1172+
#' \donttest{
11491173
#' call <- pvt_ght(auth = "yourkey", locations = "ca", epiweeks = epirange(201201, 202001), query = "?")
1150-
#' # fetch_classic(call)
1174+
#' fetch_classic(call)
1175+
#' }
11511176
#' @param auth Character. Specifies your authentication token.
11521177
#' @param locations Character vector. Specifies the locations to be fetched.
11531178
#' @param epiweeks Epirange. Specifies the epiweeks to be fetched in the form epirange(startweek,endweek), where startweek
@@ -1183,8 +1208,10 @@ pvt_ght <- function(auth, locations, epiweeks, query) {
11831208
#'
11841209
#' TODO: find a non-trivial region
11851210
#' @examples
1211+
#' \donttest{
11861212
#' call <- kcdc_ili(regions = "?", epiweeks = epirange(201201, 202001))
11871213
#' fetch_tbl(call)
1214+
#' }
11881215
#' @param regions Character vector. Specifies the regions to be fetched.
11891216
#' @param epiweeks Epirange. Specifies the epiweeks to be fetched in the form epirange(startweek,endweek), where
11901217
#' startweek and endweek are of the form YYYYWW (string or numeric).
@@ -1275,8 +1302,10 @@ meta <- function() {
12751302
#' <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_locations.txt>.
12761303
#'
12771304
#' @examples
1305+
#' \donttest{
12781306
#' call <- nidss_dengue(locations = "taipei", epiweeks = epirange(201201, 202001))
12791307
#' fetch_classic(call)
1308+
#' }
12801309
#' @param locations Character vector. Specifies the locations of interest. Possible inputs include but are not limited
12811310
#' to (1) nationwide, (2) central, (3) eastern, (4) kaoping, (5) northern, (6) southern, and (7) taipei.
12821311
#' @param epiweeks Eppirange. Specifies the epiweeks to be fetched in the form epirange(startweek,endweek), where
@@ -1307,8 +1336,10 @@ nidss_dengue <- function(locations, epiweeks) {
13071336
#' Obtains information on outpatient inluenza-like-illness from Taiwan National Infectious Disease Statistical System.
13081337
#'
13091338
#' @examples
1339+
#' \donttest{
13101340
#' call <- nidss_flu(regions = "taipei", epiweeks = epirange(201201, 202001))
13111341
#' fetch_classic(call)
1342+
#' }
13121343
#' @param regions Character vector. The regions to fetch.
13131344
#' @param epiweeks Epirange. The epiweeks to fetch in the form epirange(startweek,endweek), where
13141345
#' startweek and endweek are of the form YYYYWW (string or numeric).
@@ -1359,12 +1390,14 @@ nidss_flu <-
13591390
#' Fetch NoroSTAT data (point data, no min/max)
13601391
#'
13611392
#' @examples
1393+
#' \donttest{
13621394
#' call <- pvt_norostat(
13631395
#' auth = "yourkey",
13641396
#' location = "Minnesota, Ohio, Oregon, Tennessee, and Wisconsin",
13651397
#' epiweeks = epirange(201201, 202001)
13661398
#' )
1367-
#' # fetch_classic(call)
1399+
#' fetch_classic(call)
1400+
#' }
13681401
#' @param auth Character. Specifies the authentication key.
13691402
#' @param location Character vector. Specifies the locations of interest.
13701403
#' @param epiweeks Eppirange. Specifies the epiweeks to be fetched in the form epirange(startweek,endweek), where
@@ -1402,8 +1435,10 @@ pvt_norostat <- function(auth, location, epiweeks) {
14021435
#' <https://github.com/cmu-delphi/delphi-epidata/blob/main/src/acquisition/fluview/fluview_locations.py>.
14031436
#'
14041437
#' @examples
1438+
#' \donttest{
14051439
#' call <- nowcast(location = "ca", epiweeks = epirange(201201, 202001))
14061440
#' fetch_classic(call)
1441+
#' }
14071442
#' @param locations Character vector. The locations to be fetched, which can take ID codes in the following
14081443
#' geo types: national, HHS region, census division, most states and territories, and so on.
14091444
#' @param epiweeks Epirange. The epiweeks to fetch in the form epirange(startweek,endweek), where
@@ -1432,8 +1467,10 @@ nowcast <- function(locations, epiweeks) {
14321467
#' Fetch Paho Dengue
14331468
#'
14341469
#' @examples
1470+
#' \donttest{
14351471
#' call <- paho_dengue(regions = "ca", epiweeks = epirange(201201, 202001))
14361472
#' fetch_classic(call)
1473+
#' }
14371474
#' @param regions Character vector. The regions to fetch.
14381475
#' @param epiweeks Epirange. The epiweeks to fetch in the form epirange(startweek,endweek), where
14391476
#' startweek and endweek are of the form YYYYWW (string or numeric).
@@ -1482,8 +1519,10 @@ paho_dengue <- function(regions,
14821519
#' Fetch Quidel data
14831520
#'
14841521
#' @examples
1522+
#' \donttest{
14851523
#' call <- pvt_quidel(auth = "yourkey", epiweeks = epirange(201201, 202001), locations = "hhs1")
1486-
#' # fetch_classic(call)
1524+
#' fetch_classic(call)
1525+
#' }
14871526
#' @param auth Character. The authentication key.
14881527
#' @param epiweeks Epirange. The epiweeks to fetch in the form epirange(startweek,endweek), where
14891528
#' startweek and endweek are of the form YYYYWW (string or numeric).
@@ -1516,8 +1555,10 @@ pvt_quidel <- function(auth, epiweeks, locations) {
15161555
#' Fetch Delphi's digital surveillance sensors
15171556
#'
15181557
#' @examples
1558+
#' \donttest{
15191559
#' call <- pvt_sensors(auth = "yourkey", names = "sar3", locations = "nat", epiweeks = epirange(201501, 202001))
1520-
#' # fetch_classic(call)
1560+
#' fetch_classic(call)
1561+
#' }
15211562
#' @param auth Character. The authentication key.
15221563
#' @param names Character vector. The names of the sensors to fetch.
15231564
#' @param locations Character vector. The locations to fetch.
@@ -1554,8 +1595,10 @@ pvt_sensors <- function(auth, names, locations, epiweeks) {
15541595
#' Fetch HealthTweets data
15551596
#'
15561597
#' @examples
1598+
#' \donttest{
15571599
#' call <- pvt_twitter(auth = "yourkey", locations = "CA", epiweeks = epirange(201501, 202001))
1558-
#' # fetch_tbl(call)
1600+
#' fetch_tbl(call)
1601+
#' }
15591602
#' @param auth Character. The authentication key.
15601603
#' @param locations Character vector. The locations to fetch.
15611604
#' @param dates Epirange. The dates to fetch in the form epirange(startdate,enddate), where
@@ -1605,8 +1648,10 @@ pvt_twitter <-
16051648
#' Fetch Wikipedia access data
16061649
#'
16071650
#' @examples
1651+
#' \donttest{
16081652
#' call <- wiki(articles = "avian_influenza", epiweeks = epirange(201501, 202001))
16091653
#' fetch_tbl(call)
1654+
#' }
16101655
#' @param articles Character vector. The articles to fetch.
16111656
#' @param dates Epirange. The dates to fetch in the form epirange(startdate,enddate), where
16121657
#' startdate and enddate are of the form YYYYMMDD (string or numeric). Mutually exclusive with `epiweeks`.

0 commit comments

Comments
 (0)