Skip to content

Commit f7996dd

Browse files
committed
Documentation update
update documentation for gft, nidss_dengue, nidss_flu, nowcast, fluview, flusurv, ecdc_ili
1 parent 67713c1 commit f7996dd

11 files changed

+175
-62
lines changed

R/endpoints.R

+80-31
Original file line numberDiff line numberDiff line change
@@ -425,18 +425,26 @@ covid_hosp_facility <-
425425
)
426426
}
427427

428-
#' fetch COVID hospitalization data
428+
#' Fetch COVID Hospitalization Data by State
429429
#'
430-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/covid_hosp.html
430+
#' Obtains the COVID-19 reported patient impact and hospital capacity data by state. This dataset is provided by the US Department of Health & Human Services via healthdata.gov.
431+
#'
432+
#' @details Starting October 1, 2022, some facilities are only required to report annually.
431433
#'
432434
#' @examples
435+
#' \donttest{
433436
#' call <- covid_hosp_state_timeseries(states = "fl", dates = epirange(20200101, 20200501))
434437
#' fetch_csv(call)
435-
#' @param states states to fetch
436-
#' @param dates dates to fetch
437-
#' @param issues issues to fetch
438+
#' }
439+
#' @param states A two letter character string state abbreviation.
440+
#' @param dates Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
441+
#' @param issues An optional parameter that takes the form YYYYMMDD. If issues is not specified, then the most recent issue is used by default.
438442
#' @return an instance of epidata_call
439443
#'
444+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/covid_hosp.html>.
445+
#'
446+
#' See also the official description and data dictionary at <healthdata.gov> for more information.
447+
#'
440448
#' @export
441449
#
442450
covid_hosp_state_timeseries <-
@@ -569,7 +577,9 @@ covid_hosp_state_timeseries <-
569577

570578
#' fetch covidcast meta data
571579
#'
572-
#' Fetch a summary of metadata for all sources and signals that are available in the API, along with basic summary statistics such as the dates they are available, the geographic levels at which they are reported, and etc. For more details, see documentation at <https://cmu-delphi.github.io/delphi-epidata/api/covidcast_meta.html>.
580+
#' Fetch a summary of metadata for all sources and signals that are available in the API, along with basic summary statistics such as the dates they are available, the geographic levels at which they are reported, and etc.
581+
#'
582+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/covidcast_meta.html>.
573583
#'
574584
#' @return an instance of epidata_call
575585
#'
@@ -607,8 +617,6 @@ covidcast_meta <- function() {
607617

608618
#' fetch covidcast data
609619
#'
610-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html
611-
#'
612620
#' @examples
613621
#' call <- covidcast(
614622
#' data_source = "jhu-csse",
@@ -809,18 +817,21 @@ pvt_dengue_sensors <- function(auth, names, locations, epiweeks) {
809817

810818
#' fetch ECDC data
811819
#'
812-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/ecdc_ili.html
820+
#' Obtain information on influenza-like-illness from the European Center of Disease Control.
821+
#'
822+
#' @details The list of location argument can be found in <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/ecdc_regions.txt>.
813823
#'
814-
#' TODO: find a region that has non-trivial output
815824
#' @examples
816-
#' call <- ecdc_ili(regions = "?", epiweeks = epirange(201201, 202001))
825+
#' call <- ecdc_ili(regions = "austria", epiweeks = epirange(201201, 202001))
817826
#' fetch_classic(call)
818827
#' @param regions regions to fetch
819-
#' @param epiweeks epiweeks to fetch
828+
#' @param epiweeks Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
820829
#' @param issues optionally specify the exact issues to fetch
821830
#' @param lag optionally specify the issue lag
822831
#' @return an instance of epidata_call
823832
#'
833+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/ecdc_ili.html>.
834+
#'
824835
#' @export
825836
ecdc_ili <- function(regions,
826837
epiweeks,
@@ -854,17 +865,21 @@ ecdc_ili <- function(regions,
854865

855866
#' fetch FluSurv virological data
856867
#'
857-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/flusurv.html
868+
#' Obtain information on flu hospitalization rates from the Center of Disease Control.
869+
#'
870+
#' @details The list of location argument can be found in <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/flusurv_locations.txt>.
858871
#'
859872
#' @examples
860873
#' call <- flusurv(locations = "CA", epiweeks = epirange(201201, 202001))
861874
#' fetch_classic(call)
862-
#' @param locations locations to fetch
863-
#' @param epiweeks epiweeks to fetch
875+
#' @param locations A character string indicating location.
876+
#' @param epiweeks Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
864877
#' @param issues optionally specify the exact issues to fetch
865878
#' @param lag optionally specify the issue lag
866879
#' @return an instance of epidata_call
867880
#'
881+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/flusurv.html>. See also <https://gis.cdc.gov/GRASP/Fluview/FluHospRates.html>.
882+
#'
868883
#' @export
869884
flusurv <- function(locations,
870885
epiweeks,
@@ -973,20 +988,38 @@ fluview_meta <- function() {
973988
)
974989
}
975990

991+
#' Obtains information on outpatient inluenza-like-illness (ILI) from Delphi's epidemiological data
992+
#'
993+
#' @details The full list of location inputs can be accsssed at <https://github.com/cmu-delphi/delphi-epidata/blob/main/src/acquisition/fluview/fluview_locations.py>.
994+
#'
995+
#' @examples
996+
#' call <- nowcast(location = "ca", epiweeks = epirange(201201, 202001))
997+
#' fetch_classic(call)
998+
#' @param locations a character string that indicates a location such as national, HHS region, census division, most states and territories, and etc.
999+
#' @param Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
1000+
#' @return an instance of epidata_call
1001+
#'
1002+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/nowcast.html>.
1003+
1004+
9761005
#' fetch fluview data
9771006
#'
978-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/fluview.html
1007+
#' Obtains information on outpatient inluenza-like-illness (ILI) from U.S. Outpatient Influenza-like Illness Surveillance Network (ILINet).
1008+
#'
1009+
#' @details The full list of location inputs can be accsssed at <https://github.com/cmu-delphi/delphi-epidata/blob/main/src/acquisition/fluview/fluview_locations.py>.
9791010
#'
9801011
#' @examples
9811012
#' call <- fluview(regions = "nat", epiweeks = epirange(201201, 202001))
9821013
#' fetch_classic(call)
983-
#' @param regions regions to fetch
984-
#' @param epiweeks epiweeks to fetch
985-
#' @param issues optionally specify the exact issues to fetch
1014+
#' @param regions a character string that indicates a location such as national, HHS region, census division, most states and territories, and etc.
1015+
#' @param epiweeks Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
1016+
#' @param issues an optional parameter that takes the form YYYYMMDD specifying the exact issues to fetch.
9861017
#' @param lag optionally specify the issue lag
9871018
#' @param auth optional authentication
9881019
#' @return an instance of epidata_call
9891020
#'
1021+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/fluview.html>. For more information on ILINet, see <https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html>.
1022+
#'
9901023
#' @export
9911024
fluview <-
9921025
function(regions,
@@ -1034,13 +1067,18 @@ fluview <-
10341067

10351068
#' fetch Google Flu Trends data
10361069
#'
1037-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/gft.html
1070+
#' Obtains estimates of inluenza activity based on volume of certain search queries from Google.
1071+
#'
1072+
#' @details Google has discontinues Flu Trends, and this is now a static endpoint. Possibile input for locations can be found in <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt>, <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/states.txt>, and <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/cities.txt>.
10381073
#'
10391074
#' @examples
10401075
#' call <- gft(locations = "hhs1", epiweeks = epirange(201201, 202001))
10411076
#' fetch_classic(call)
1042-
#' @param locations locations to fetch
1043-
#' @param epiweeks epiweeks to fetch
1077+
#' @param locations A character string that specifies a location to be fetched.
1078+
#' @param epiweeks Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
1079+
#'
1080+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/gft.html>
1081+
#'
10441082
#' @return an instance of epidata_call
10451083
#'
10461084
#' @export
@@ -1180,15 +1218,20 @@ meta <- function() {
11801218

11811219
#' fetch NIDSS dengue data
11821220
#'
1183-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/nidss_dengue.html
1221+
#' Obtains counts of confirmed dengue cases in Taiwan from Taiwan National Infectious Disease Statistical System.
1222+
#'
1223+
#' @details Possible location inputs can be found in <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_regions.txt> and <https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_locations.txt>.
11841224
#'
11851225
#' @examples
11861226
#' call <- nidss_dengue(locations = "taipei", epiweeks = epirange(201201, 202001))
11871227
#' fetch_classic(call)
1188-
#' @param locations locations to fech
1189-
#' @param epiweeks epiweeks to fetch
1228+
#' @param locations A character string that indicates region of interest or location of interest. Possible inputs include but are not limited to (1) nationwide, (2) central, (3) eastern, (4) kaoping, (5) northern, (6) southern, and (7) taipei.
1229+
#' @param epiweeks Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
1230+
#'
11901231
#' @return an instance of epidata_call
11911232
#'
1233+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/nidss_dengue.html>
1234+
#'
11921235
#' @export
11931236
nidss_dengue <- function(locations, epiweeks) {
11941237
check_string_param("locations", locations)
@@ -1207,17 +1250,19 @@ nidss_dengue <- function(locations, epiweeks) {
12071250

12081251
#' fetch NIDSS flu data
12091252
#'
1210-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/nidss_flu.html
1253+
#' Obtains information on outpatient inluenza-like-illness from Taiwan National Infectious Disease Statistical System.
12111254
#'
12121255
#' @examples
12131256
#' call <- nidss_flu(regions = "taipei", epiweeks = epirange(201201, 202001))
12141257
#' fetch_classic(call)
12151258
#' @param regions regions to fetch
1216-
#' @param epiweeks epiweeks to fetch
1259+
#' @param epiweeks Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
12171260
#' @param issues optional issues
12181261
#' @param lag optional lag
12191262
#' @return an instance of epidata_call
12201263
#'
1264+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/nidss_flu.html>
1265+
#'
12211266
#' @export
12221267
nidss_flu <-
12231268
function(regions,
@@ -1291,17 +1336,21 @@ pvt_norostat <- function(auth, location, epiweeks) {
12911336
)
12921337
}
12931338

1294-
#' fetch Delphi's wILI nowcast
1339+
#' fetch Delphi's ILI nowcast
1340+
#'
1341+
#' Obtains information on outpatient inluenza-like-illness (ILI) from Delphi's epidemiological data
12951342
#'
1296-
#' API docs: https://cmu-delphi.github.io/delphi-epidata/api/nowcast.html
1343+
#' @details The full list of location inputs can be accsssed at <https://github.com/cmu-delphi/delphi-epidata/blob/main/src/acquisition/fluview/fluview_locations.py>.
12971344
#'
12981345
#' @examples
12991346
#' call <- nowcast(location = "ca", epiweeks = epirange(201201, 202001))
13001347
#' fetch_classic(call)
1301-
#' @param locations locations to fetch
1302-
#' @param epiweeks epiweeks to fetch
1348+
#' @param locations a character string that indicates a location such as national, HHS region, census division, most states and territories, and etc.
1349+
#' @param Takes in the form epirange(startdate,enddate), where startdate and enddate are of the form YYYYMMDD (can be passed as string or numeric).
13031350
#' @return an instance of epidata_call
13041351
#'
1352+
#' @references API Documentation: <https://cmu-delphi.github.io/delphi-epidata/api/nowcast.html>.
1353+
#'
13051354
#' @export
13061355
nowcast <- function(locations, epiweeks) {
13071356
check_string_param("locations", locations)

man/covid_hosp_state_timeseries.Rd

+15-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/covidcast.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/covidcast_meta.Rd

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ecdc_ili.Rd

+7-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/flusurv.Rd

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)