From 7ef58d5535b8444791ee2641210f3d22cd287dd9 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Sun, 2 Nov 2025 15:01:15 -0800 Subject: [PATCH 01/16] docs: Correct `save_api_key` process It clarifies that the API key needs to be manually updated and closes issue 295. --- R/auth.R | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/R/auth.R b/R/auth.R index 53ff13b5..ca5d99ff 100644 --- a/R/auth.R +++ b/R/auth.R @@ -11,12 +11,15 @@ #' key](https://api.delphi.cmu.edu/epidata/admin/registration_form). #' #' API keys are strings read from the environment variable `DELPHI_EPIDATA_KEY`. -#' We recommend setting your key with `save_api_key()`, which will modify an -#' applicable `.Renviron` file, which will be read in automatically when you -#' start future R sessions (see [`?Startup`][base::Startup] for details on -#' `.Renviron` files). Alternatively, you can modify the environment variable at -#' the command line before/while launching R, or inside an R session with -#' [`Sys.setenv()`], but these will not persist across sessions. +#' We recommend setting your key with `save_api_key()`, which will open your +#' `.Renviron` file in a text editor. You will need to write +#' `DELPHI_EPIDATA_KEY=yourkeyhere` (without quotes) in the file and save it. +#' Once the `.Renviron` file has been saved as instructed, it will be read +#' automatically when you start future R sessions +#' (see [`?Startup`][base::Startup] for details on `.Renviron` files). +#' Alternatively, you can modify the environment variable at the command line +#' before/while launching R, or inside an R session with [`Sys.setenv()`], +#' but these will not persist across sessions. #' #' Once an API key is set, it is automatically used for all requests made by #' functions in this package. From e178ffa06ec8d1b606ea7d45af16c608577a4fb7 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Sun, 2 Nov 2025 17:51:15 -0800 Subject: [PATCH 02/16] doc: Indicates that the norovirus endpoint is currently inactive. This closes issue 287 since the location does not need to be specified. --- R/endpoints.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/endpoints.R b/R/endpoints.R index 1f789d18..c1ce3c3c 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -1837,6 +1837,8 @@ pub_nidss_flu <- function( #' CDC NoroSTAT norovirus outbreaks #' @description +#' \strong{This endpoind is currently inactive in the Epidata API.} +#' #' This is point data only, and does not include minima or maxima. #' #' API docs: @@ -1853,7 +1855,8 @@ pub_nidss_flu <- function( #' ) #' } #' @param auth string. Your authentication key. -#' @param locations character. Locations to fetch. +#' @param locations character. Locations to fetch. Only full state names are +#' permitted in the list. #' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. #' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`tibble::tibble`] From 2af5832de5b60c36bdd0f8020edbe837ef303448 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 4 Nov 2025 09:22:11 -0800 Subject: [PATCH 03/16] =?UTF-8?q?doc:=20create=20.epidatr=5Fshared=5Fparam?= =?UTF-8?q?s=20base=20documentation=20and=20add=20a=20Data=20Versioning=20?= =?UTF-8?q?section=20To=20reduce=20repetition,=20epidatr=5Fshared=5Fparams?= =?UTF-8?q?=20contains=20shared=20parameters=20that=20are=20inherited=20by?= =?UTF-8?q?=20the=20functions=E2=80=99=20documentation.=20Data=20Versionin?= =?UTF-8?q?g=20is=20also=20inherited=20where=20necessary.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/endpoints.R | 251 ++++++++++--------------- man/covidcast_epidata.Rd | 4 +- man/dot-epidatr_shared_params.Rd | 59 ++++++ man/get_api_key.Rd | 15 +- man/pub_covid_hosp_facility.Rd | 3 +- man/pub_covid_hosp_facility_lookup.Rd | 3 +- man/pub_covid_hosp_state_timeseries.Rd | 30 ++- man/pub_covidcast.Rd | 35 ++-- man/pub_covidcast_meta.Rd | 3 +- man/pub_delphi.Rd | 3 +- man/pub_dengue_nowcast.Rd | 7 +- man/pub_ecdc_ili.Rd | 29 ++- man/pub_flusurv.Rd | 29 ++- man/pub_fluview.Rd | 36 ++-- man/pub_fluview_clinical.Rd | 33 +++- man/pub_fluview_meta.Rd | 3 +- man/pub_gft.Rd | 7 +- man/pub_kcdc_ili.Rd | 29 ++- man/pub_meta.Rd | 3 +- man/pub_nidss_dengue.Rd | 7 +- man/pub_nidss_flu.Rd | 29 ++- man/pub_nowcast.Rd | 7 +- man/pub_paho_dengue.Rd | 29 ++- man/pub_wiki.Rd | 7 +- man/pvt_cdc.Rd | 10 +- man/pvt_dengue_sensors.Rd | 12 +- man/pvt_ght.Rd | 9 +- man/pvt_meta_norostat.Rd | 5 +- man/pvt_norostat.Rd | 12 +- man/pvt_quidel.Rd | 9 +- man/pvt_sensors.Rd | 12 +- man/pvt_twitter.Rd | 11 +- 32 files changed, 452 insertions(+), 289 deletions(-) create mode 100644 man/dot-epidatr_shared_params.Rd diff --git a/R/endpoints.R b/R/endpoints.R index c1ce3c3c..fd6e973e 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -1,3 +1,46 @@ +#' @title Shared Documentation for epidatr Parameters +#' +#' @description This is a central text for parameter documentation +#' +#' @name .epidatr_shared_params +#' +#' @param auth string. Your restricted access key (not the same as API key). +#' @param locations character. Vector of locations to fetch. +#' @param states character. Two letter state abbreviations. +#' @param regions character. Vector of regions to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. Supports +#' @param time_type string. The temporal resolution of the data (either "day" or +#' "week", depending on signal). +#' @param names character. Names to fetch. +#' [`epirange()`] and defaults to all ("*") dates. +#' @param dates [`timeset`]. Dates to fetch. Supports +#' [`epirange()`] and defaults to all ("*") dates. +#' @param time_values [`timeset`]. Dates or epiweeks to fetch. +#' Supports [`epirange()`] and defaults to all ("*") dates. +#' @param as_of Date. Optionally, the as-of date for the issues to fetch. +#' See the "Data Versioning" section for details. +#' @param issues [`timeset`]. Optionally, the issue(s) of the +#' data to fetch. See the "Data Versioning" section for details. +#' @param lag integer. Optionally, the lag of the issues to fetch. +#' See the "Data Versioning" section for details. +#' @param fetch_args [`fetch_args`]. Additional arguments to pass +#' to `fetch()`. See `fetch_args_list()` for details. +#' @param ... not used for values, forces later arguments to bind by name +#' +#' @section Data Versioning: +#' Several endpoints support retrieving historical versions of the data. +#' The following parameters control this and are mutually exclusive (only +#' one can be provided at a time). +#' \itemize{ +#' \item \code{as_of}: (Date) Retrieve the data as it was on this date. +#' \item \code{issues}: [`timeset`] Retrieve data from a +#' specific issue date or range. +#' \item \code{lag}: (integer) Retrieve data with a specific lag from +#' its issue date. +#' } +NULL + + #' CDC total and by topic webpage visits #' #' @description @@ -12,11 +55,7 @@ #' ) #' } #' -#' @param auth string. Restricted access key (not the same as API key). -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. -#' See `fetch_args_list()` for details. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' #' @keywords endpoint @@ -75,13 +114,12 @@ pvt_cdc <- function( #' pub_covid_hosp_facility_lookup(state = "fl") #' pub_covid_hosp_facility_lookup(city = "southlake") #' } -#' @param ... not used for values, forces later arguments to bind by name +#' @inheritParams .epidatr_shared_params #' @param state string. A two-letter character state abbreviation. #' @param ccn string. A facility CMS certification number. #' @param city string. A city name. #' @param zip string. A 5-digit zip code. #' @param fips_code string. A 5-digit fips county code, zero-padded. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`tibble::tibble`] #' #' @seealso [`pub_covid_hosp_facility()`] @@ -167,12 +205,11 @@ pub_covid_hosp_facility_lookup <- function( #' collection_weeks = epirange(20240101, 20240301) #' ) #' } +#' @inheritParams .epidatr_shared_params #' @param hospital_pks character. Facility identifiers. #' @param collection_weeks [`timeset`]. Dates (corresponding to epiweeks) to #' fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name #' @param publication_dates [`timeset`]. Publication dates to fetch. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`tibble::tibble`] #' #' @importFrom checkmate test_class test_integerish test_character @@ -551,16 +588,10 @@ pub_covid_hosp_facility <- function( #' ) #' } #' -#' @param states character. Two letter state abbreviations. -#' @param dates [`timeset`]. Dates to fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param as_of Date. Optionally, the as of date for the issues to fetch. If not -#' specified, the most recent data is returned. Mutually exclusive with -#' `issues`. -#' @param issues [`timeset`]. Optionally, the issue of the data to fetch. If not -#' specified, the most recent issue is returned. Mutually exclusive with -#' `as_of` or `lag`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @return [`tibble::tibble`] #' #' @keywords endpoint @@ -880,7 +911,7 @@ pub_covid_hosp_state_timeseries <- function( #' the API, along with basic summary statistics such as the dates they are #' available, the geographic levels at which they are reported, and etc. #' -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' #' @return [`tibble::tibble`] #' @@ -953,31 +984,20 @@ pub_covidcast_meta <- function(fetch_args = fetch_args_list()) { #' ) #' } #' +#' @inheritParams .epidatr_shared_params #' @param source string. The data source to query (see: #' ). #' @param signals string. The signals to query from a specific source (see: #' ). #' @param geo_type string. The geographic resolution of the data (see: #' ). -#' @param time_type string. The temporal resolution of the data (either "day" or -#' "week", depending on signal). #' @param geo_values character. The geographies to return. Defaults to all #' ("*") geographies within requested geographic resolution (see: #' .). -#' @param time_values [`timeset`]. Dates to fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param as_of Date. Optionally, the as of date for the issues to fetch. If not -#' specified, the most recent data is returned. Mutually exclusive with -#' `issues` or `lag`. -#' @param issues [`timeset`]. Optionally, the issue of the data to fetch. If not -#' specified, the most recent issue is returned. Mutually exclusive with -#' `as_of` or `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `as_of` or -#' `issues`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`tibble::tibble`] #' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @seealso [pub_covidcast_meta()], [covidcast_epidata()], [epirange()] #' @keywords endpoint #' @export @@ -1089,10 +1109,10 @@ pub_covidcast <- function( #' \dontrun{ #' pub_delphi(system = "ec", epiweek = 201501) #' } +#' @inheritParams .epidatr_shared_params #' @param system character. System name to fetch. #' @param epiweek [`timeset`]. Epiweek to fetch. Does not support multiple dates. #' Make separate calls to fetch data for multiple epiweeks. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`list`] #' @keywords endpoint #' @export @@ -1127,9 +1147,7 @@ pub_delphi <- function( #' epiweeks = epirange(201401, 202301) #' ) #' } -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -1168,11 +1186,7 @@ pub_dengue_nowcast <- function( #' epiweeks = epirange(201501, 202001) #' ) #' } -#' @param auth string. Restricted access key (not the same as API key). -#' @param names character. Names to fetch. -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -1222,15 +1236,11 @@ pvt_dengue_sensors <- function( #' \dontrun{ #' pub_ecdc_ili(regions = "austria", epiweeks = epirange(201901, 202001)) #' } -#' @param regions character. Regions to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the -#' most recent issue is returned. Mutually exclusive with `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `issues`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @keywords endpoint #' @export pub_ecdc_ili <- function( @@ -1289,15 +1299,11 @@ pub_ecdc_ili <- function( #' \dontrun{ #' pub_flusurv(locations = "CA", epiweeks = epirange(201701, 201801)) #' } -#' @param locations character. Character vector indicating location. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the -#' most recent issue is returned. Mutually exclusive with `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `issues`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @keywords endpoint #' @export pub_flusurv <- function( @@ -1353,17 +1359,14 @@ pub_flusurv <- function( #' \dontrun{ #' pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) #' } -#' @param regions character. Regions to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch in the form -#' epirange(startweek,endweek), where startweek and endweek are of the form -#' YYYYWW (string or numeric). Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the -#' most recent issue is returned. Mutually exclusive with `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `issues`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params +#' @param regions character. Locations to fetch. Can be any string IDs in +#' national, HHS region, census division, most states and territories, and so +#' on. Full list link below. #' @return [`tibble::tibble`] +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @keywords endpoint #' @export pub_fluview_clinical <- function( @@ -1420,7 +1423,7 @@ pub_fluview_clinical <- function( #' pub_fluview_meta() #' } #' -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' #' @return [`tibble::tibble`] #' @seealso [`pub_fluview()`] @@ -1456,21 +1459,12 @@ pub_fluview_meta <- function(fetch_args = fetch_args_list()) { #' \dontrun{ #' pub_fluview(regions = "nat", epiweeks = epirange(201201, 202005)) #' } -#' @param regions character. Locations to fetch. Can be any string IDs in -#' national, HHS region, census division, most states and territories, and so -#' on. Full list link below. -#' @param epiweeks [`timeset`]. Epiweeks to fetch in the form -#' `epirange(startweek, endweek)`, where startweek and endweek are of the form -#' YYYYWW (string or numeric). Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the -#' most recent issue is returned. Mutually exclusive with `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `issues`. -#' @param auth string. Optionally, restricted access key (not the same as API -#' key). -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params +#' @inheritParams pub_fluview_clinical #' @return [`tibble::tibble`] +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @keywords endpoint #' @export pub_fluview <- function( @@ -1546,9 +1540,7 @@ pub_fluview <- function( #' \dontrun{ #' pub_gft(locations = "hhs1", epiweeks = epirange(201201, 202001)) #' } -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`] Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' #' @return [`tibble::tibble`] #' @keywords endpoint @@ -1590,11 +1582,8 @@ pub_gft <- function( #' query = "how to get over the flu" #' ) #' } -#' @param auth string. Restricted access key (not the same as API key). -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. +#' @inheritParams .epidatr_shared_params #' @param query string. The query to be fetched. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -1636,15 +1625,11 @@ pvt_ght <- function( #' \dontrun{ #' pub_kcdc_ili(regions = "ROK", epiweeks = 200436) #' } -#' @param regions character. Regions to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the -#' most recent issue is returned. Mutually exclusive with `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `issues`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @keywords endpoint #' @export pub_kcdc_ili <- function( @@ -1695,8 +1680,7 @@ pub_kcdc_ili <- function( #' \dontrun{ #' pvt_meta_norostat(auth = Sys.getenv("SECRET_API_AUTH_NOROSTAT")) #' } -#' @param auth string. Restricted access key (not the same as API key). -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`list`] #' @seealso [`pvt_norostat()`] #' @keywords endpoint @@ -1715,7 +1699,7 @@ pvt_meta_norostat <- function(auth, fetch_args = fetch_args_list()) { #' @description #' API docs: #' -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' #' @return [`list`] #' @keywords endpoint @@ -1741,9 +1725,7 @@ pub_meta <- function(fetch_args = fetch_args_list()) { #' \dontrun{ #' pub_nidss_dengue(locations = "taipei", epiweeks = epirange(201201, 201301)) #' } -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' #' @return [`tibble::tibble`] #' @keywords endpoint @@ -1781,15 +1763,11 @@ pub_nidss_dengue <- function( #' \dontrun{ #' pub_nidss_flu(regions = "taipei", epiweeks = epirange(201501, 201601)) #' } -#' @param regions character. Regions to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the -#' most recent issue is returned. Mutually exclusive with `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `issues`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @keywords endpoint #' @export pub_nidss_flu <- function( @@ -1854,11 +1832,9 @@ pub_nidss_flu <- function( #' epiweeks = 201233 #' ) #' } -#' @param auth string. Your authentication key. +#' @inheritParams .epidatr_shared_params #' @param locations character. Locations to fetch. Only full state names are #' permitted in the list. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -1902,9 +1878,7 @@ pvt_norostat <- function( #' \dontrun{ #' pub_nowcast(locations = "ca", epiweeks = epirange(201201, 201301)) #' } -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -1938,15 +1912,11 @@ pub_nowcast <- function( #' \dontrun{ #' pub_paho_dengue(regions = "ca", epiweeks = epirange(201401, 201501)) #' } -#' @param regions character. Regions to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param ... not used for values, forces later arguments to bind by name -#' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the -#' most recent issue is returned. Mutually exclusive with `lag`. -#' @param lag integer. Optionally, the lag of the issues to fetch. If not set, -#' the most recent issue is returned. Mutually exclusive with `issues`. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] +#' +#' @inheritSection .epidatr_shared_params Data Versioning +#' #' @keywords endpoint #' @export pub_paho_dengue <- function( @@ -2005,10 +1975,7 @@ pub_paho_dengue <- function( #' locations = "hhs1" #' ) #' } -#' @param auth string. Restricted access key (not the same as API key). -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -2063,11 +2030,7 @@ pvt_quidel <- function( #' epiweeks = epirange(201501, 202001) #' ) #' } -#' @param auth string. Restricted access key (not the same as API key). -#' @param names character. Sensor names to fetch. -#' @param locations character. Locations to fetch. -#' @param epiweeks [`timeset`]. Epiweeks to fetch. Defaults to all ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -2119,14 +2082,7 @@ pvt_sensors <- function( #' time_values = epirange(201501, 202001) #' ) #' } -#' @param auth string. Restricted access key (not the same as API key). -#' @param locations character. Locations to fetch. -#' @param ... not used for values, forces later arguments to bind by name -#' @param time_type string. The temporal resolution of the data (either "day" or -#' "week", depending on signal). -#' @param time_values [`timeset`]. Dates or epiweeks to fetch. Defaults to all -#' ("*") dates. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint #' @export @@ -2202,15 +2158,10 @@ pvt_twitter <- function( #' time_values = epirange(201501, 201601) #' ) #' } +#' @inheritParams .epidatr_shared_params #' @param articles character. Articles to fetch. -#' @param ... not used for values, forces later arguments to bind by name -#' @param time_type string. The temporal resolution of the data (either "day" or -#' "week", depending on signal). -#' @param time_values [`timeset`]. Dates or epiweeks to fetch. Defaults to all -#' ("*") dates. #' @param language string. Language to fetch. #' @param hours integer. Optionally, the hours to fetch. -#' @param fetch_args [`fetch_args`]. Additional arguments to pass to `fetch()`. #' @return [`tibble::tibble`] #' @keywords endpoint #' @export diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index fbf3f1cc..e3a997a8 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 468 x 3 +#> # A tibble: 508 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 458 more rows +#> # i 498 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type diff --git a/man/dot-epidatr_shared_params.Rd b/man/dot-epidatr_shared_params.Rd new file mode 100644 index 00000000..eb6e4cb2 --- /dev/null +++ b/man/dot-epidatr_shared_params.Rd @@ -0,0 +1,59 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/endpoints.R +\name{.epidatr_shared_params} +\alias{.epidatr_shared_params} +\title{Shared Documentation for epidatr Parameters} +\arguments{ +\item{auth}{string. Your restricted access key (not the same as API key).} + +\item{locations}{character. Vector of locations to fetch.} + +\item{states}{character. Two letter state abbreviations.} + +\item{regions}{character. Vector of regions to fetch.} + +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} + +\item{time_type}{string. The temporal resolution of the data (either "day" or +"week", depending on signal).} + +\item{names}{character. Names to fetch. +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} + +\item{dates}{\code{\link{timeset}}. Dates to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} + +\item{time_values}{\code{\link{timeset}}. Dates or epiweeks to fetch. +Supports \code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} + +\item{as_of}{Date. Optionally, the as-of date for the issues to fetch. +See the "Data Versioning" section for details.} + +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} + +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} + +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} + +\item{...}{not used for values, forces later arguments to bind by name} +} +\description{ +This is a central text for parameter documentation +} +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + diff --git a/man/get_api_key.Rd b/man/get_api_key.Rd index 2fd9b1b7..e1a33eeb 100644 --- a/man/get_api_key.Rd +++ b/man/get_api_key.Rd @@ -24,12 +24,15 @@ including a rate limit. If you regularly request large amounts of data, please consider \href{https://api.delphi.cmu.edu/epidata/admin/registration_form}{registering for an API key}. API keys are strings read from the environment variable \code{DELPHI_EPIDATA_KEY}. -We recommend setting your key with \code{save_api_key()}, which will modify an -applicable \code{.Renviron} file, which will be read in automatically when you -start future R sessions (see \code{\link[base:Startup]{?Startup}} for details on -\code{.Renviron} files). Alternatively, you can modify the environment variable at -the command line before/while launching R, or inside an R session with -\code{\link[=Sys.setenv]{Sys.setenv()}}, but these will not persist across sessions. +We recommend setting your key with \code{save_api_key()}, which will open your +\code{.Renviron} file in a text editor. You will need to write +\code{DELPHI_EPIDATA_KEY=yourkeyhere} (without quotes) in the file and save it. +Once the \code{.Renviron} file has been saved as instructed, it will be read +automatically when you start future R sessions +(see \code{\link[base:Startup]{?Startup}} for details on \code{.Renviron} files). +Alternatively, you can modify the environment variable at the command line +before/while launching R, or inside an R session with \code{\link[=Sys.setenv]{Sys.setenv()}}, +but these will not persist across sessions. Once an API key is set, it is automatically used for all requests made by functions in this package. diff --git a/man/pub_covid_hosp_facility.Rd b/man/pub_covid_hosp_facility.Rd index c71f21c0..65bec6c7 100644 --- a/man/pub_covid_hosp_facility.Rd +++ b/man/pub_covid_hosp_facility.Rd @@ -22,7 +22,8 @@ fetch. Defaults to all ("*") dates.} \item{publication_dates}{\code{\link{timeset}}. Publication dates to fetch.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_covid_hosp_facility_lookup.Rd b/man/pub_covid_hosp_facility_lookup.Rd index 718d153b..1451a949 100644 --- a/man/pub_covid_hosp_facility_lookup.Rd +++ b/man/pub_covid_hosp_facility_lookup.Rd @@ -27,7 +27,8 @@ pub_covid_hosp_facility_lookup( \item{fips_code}{string. A 5-digit fips county code, zero-padded.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_covid_hosp_state_timeseries.Rd b/man/pub_covid_hosp_state_timeseries.Rd index 246bf7b1..bd5afd9d 100644 --- a/man/pub_covid_hosp_state_timeseries.Rd +++ b/man/pub_covid_hosp_state_timeseries.Rd @@ -16,19 +16,19 @@ pub_covid_hosp_state_timeseries( \arguments{ \item{states}{character. Two letter state abbreviations.} -\item{dates}{\code{\link{timeset}}. Dates to fetch. Defaults to all ("*") dates.} +\item{dates}{\code{\link{timeset}}. Dates to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} -\item{as_of}{Date. Optionally, the as of date for the issues to fetch. If not -specified, the most recent data is returned. Mutually exclusive with -\code{issues}.} +\item{as_of}{Date. Optionally, the as-of date for the issues to fetch. +See the "Data Versioning" section for details.} -\item{issues}{\code{\link{timeset}}. Optionally, the issue of the data to fetch. If not -specified, the most recent issue is returned. Mutually exclusive with -\code{as_of} or \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -44,6 +44,20 @@ Services. Starting October 1, 2022, some facilities are only required to report annually. } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_covid_hosp_state_timeseries( diff --git a/man/pub_covidcast.Rd b/man/pub_covidcast.Rd index 2f6a2bab..0895365d 100644 --- a/man/pub_covidcast.Rd +++ b/man/pub_covidcast.Rd @@ -35,23 +35,22 @@ pub_covidcast( ("*") geographies within requested geographic resolution (see: \url{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html}.).} -\item{time_values}{\code{\link{timeset}}. Dates to fetch. Defaults to all ("*") dates.} +\item{time_values}{\code{\link{timeset}}. Dates or epiweeks to fetch. +Supports \code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} -\item{as_of}{Date. Optionally, the as of date for the issues to fetch. If not -specified, the most recent data is returned. Mutually exclusive with -\code{issues} or \code{lag}.} +\item{as_of}{Date. Optionally, the as-of date for the issues to fetch. +See the "Data Versioning" section for details.} -\item{issues}{\code{\link{timeset}}. Optionally, the issue of the data to fetch. If not -specified, the most recent issue is returned. Mutually exclusive with -\code{as_of} or \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{as_of} or -\code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -63,6 +62,20 @@ The primary endpoint for fetching COVID-19 data, providing access to a wide variety of signals from a wide variety of sources. See the API documentation link above for more. Delphi's \href{https://delphi.cmu.edu/covidcast/}{COVIDcast public dashboard} is powered by this endpoint. } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_covidcast( diff --git a/man/pub_covidcast_meta.Rd b/man/pub_covidcast_meta.Rd index 6b7b183d..a5ef892a 100644 --- a/man/pub_covidcast_meta.Rd +++ b/man/pub_covidcast_meta.Rd @@ -7,7 +7,8 @@ pub_covidcast_meta(fetch_args = fetch_args_list()) } \arguments{ -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_delphi.Rd b/man/pub_delphi.Rd index fe278beb..5df3ea6a 100644 --- a/man/pub_delphi.Rd +++ b/man/pub_delphi.Rd @@ -12,7 +12,8 @@ pub_delphi(system, epiweek, fetch_args = fetch_args_list()) \item{epiweek}{\code{\link{timeset}}. Epiweek to fetch. Does not support multiple dates. Make separate calls to fetch data for multiple epiweeks.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link{list}} diff --git a/man/pub_dengue_nowcast.Rd b/man/pub_dengue_nowcast.Rd index e1c2573c..9f4ac4e0 100644 --- a/man/pub_dengue_nowcast.Rd +++ b/man/pub_dengue_nowcast.Rd @@ -7,11 +7,12 @@ pub_dengue_nowcast(locations, epiweeks = "*", fetch_args = fetch_args_list()) } \arguments{ -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_ecdc_ili.Rd b/man/pub_ecdc_ili.Rd index d71b5651..7c1b380a 100644 --- a/man/pub_ecdc_ili.Rd +++ b/man/pub_ecdc_ili.Rd @@ -14,19 +14,20 @@ pub_ecdc_ili( ) } \arguments{ -\item{regions}{character. Regions to fetch.} +\item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{...}{not used for values, forces later arguments to bind by name} -\item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the -most recent issue is returned. Mutually exclusive with \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -41,6 +42,20 @@ Disease Prevention and Control. The list of location argument can be found in \url{https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/ecdc_regions.txt}. } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_ecdc_ili(regions = "austria", epiweeks = epirange(201901, 202001)) diff --git a/man/pub_flusurv.Rd b/man/pub_flusurv.Rd index e8fd5bb0..dd0c007b 100644 --- a/man/pub_flusurv.Rd +++ b/man/pub_flusurv.Rd @@ -14,19 +14,20 @@ pub_flusurv( ) } \arguments{ -\item{locations}{character. Character vector indicating location.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{...}{not used for values, forces later arguments to bind by name} -\item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the -most recent issue is returned. Mutually exclusive with \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -43,6 +44,20 @@ See also \url{https://gis.cdc.gov/GRASP/Fluview/FluHospRates.html}. The list of location argument can be found in \url{https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/flusurv_locations.txt}. } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_flusurv(locations = "CA", epiweeks = epirange(201701, 201801)) diff --git a/man/pub_fluview.Rd b/man/pub_fluview.Rd index 61ba357a..1b599498 100644 --- a/man/pub_fluview.Rd +++ b/man/pub_fluview.Rd @@ -15,26 +15,22 @@ pub_fluview( ) } \arguments{ -\item{regions}{character. Locations to fetch. Can be any string IDs in -national, HHS region, census division, most states and territories, and so -on. Full list link below.} +\item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch in the form -\code{epirange(startweek, endweek)}, where startweek and endweek are of the form -YYYYWW (string or numeric). Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{...}{not used for values, forces later arguments to bind by name} -\item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the -most recent issue is returned. Mutually exclusive with \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{auth}{string. Optionally, restricted access key (not the same as API -key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -52,6 +48,20 @@ more information on ILINet, see The full list of location inputs can be accessed at \url{https://github.com/cmu-delphi/delphi-epidata/blob/main/src/acquisition/fluview/fluview_locations.py}. } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_fluview(regions = "nat", epiweeks = epirange(201201, 202005)) diff --git a/man/pub_fluview_clinical.Rd b/man/pub_fluview_clinical.Rd index a4017c76..318ab808 100644 --- a/man/pub_fluview_clinical.Rd +++ b/man/pub_fluview_clinical.Rd @@ -14,21 +14,22 @@ pub_fluview_clinical( ) } \arguments{ -\item{regions}{character. Regions to fetch.} +\item{regions}{character. Locations to fetch. Can be any string IDs in +national, HHS region, census division, most states and territories, and so +on. Full list link below.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch in the form -epirange(startweek,endweek), where startweek and endweek are of the form -YYYYWW (string or numeric). Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{...}{not used for values, forces later arguments to bind by name} -\item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the -most recent issue is returned. Mutually exclusive with \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -36,6 +37,20 @@ the most recent issue is returned. Mutually exclusive with \code{issues}.} \description{ API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/fluview_clinical.html} } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) diff --git a/man/pub_fluview_meta.Rd b/man/pub_fluview_meta.Rd index ab0c0b1a..39e14e7a 100644 --- a/man/pub_fluview_meta.Rd +++ b/man/pub_fluview_meta.Rd @@ -7,7 +7,8 @@ pub_fluview_meta(fetch_args = fetch_args_list()) } \arguments{ -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_gft.Rd b/man/pub_gft.Rd index c80d8d9a..ecfbc23f 100644 --- a/man/pub_gft.Rd +++ b/man/pub_gft.Rd @@ -7,11 +7,12 @@ pub_gft(locations, epiweeks = "*", fetch_args = fetch_args_list()) } \arguments{ -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}} Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_kcdc_ili.Rd b/man/pub_kcdc_ili.Rd index 0c8b70f4..c143a845 100644 --- a/man/pub_kcdc_ili.Rd +++ b/man/pub_kcdc_ili.Rd @@ -14,19 +14,20 @@ pub_kcdc_ili( ) } \arguments{ -\item{regions}{character. Regions to fetch.} +\item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{...}{not used for values, forces later arguments to bind by name} -\item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the -most recent issue is returned. Mutually exclusive with \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -34,6 +35,20 @@ the most recent issue is returned. Mutually exclusive with \code{issues}.} \description{ API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/kcdc_ili.html} } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_kcdc_ili(regions = "ROK", epiweeks = 200436) diff --git a/man/pub_meta.Rd b/man/pub_meta.Rd index 202d3cfa..b06b8537 100644 --- a/man/pub_meta.Rd +++ b/man/pub_meta.Rd @@ -7,7 +7,8 @@ pub_meta(fetch_args = fetch_args_list()) } \arguments{ -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link{list}} diff --git a/man/pub_nidss_dengue.Rd b/man/pub_nidss_dengue.Rd index 67be9c94..7a51cff4 100644 --- a/man/pub_nidss_dengue.Rd +++ b/man/pub_nidss_dengue.Rd @@ -7,11 +7,12 @@ pub_nidss_dengue(locations, epiweeks = "*", fetch_args = fetch_args_list()) } \arguments{ -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_nidss_flu.Rd b/man/pub_nidss_flu.Rd index 946a1b87..41ec40f3 100644 --- a/man/pub_nidss_flu.Rd +++ b/man/pub_nidss_flu.Rd @@ -14,19 +14,20 @@ pub_nidss_flu( ) } \arguments{ -\item{regions}{character. Regions to fetch.} +\item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{...}{not used for values, forces later arguments to bind by name} -\item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the -most recent issue is returned. Mutually exclusive with \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -37,6 +38,20 @@ API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/nidss_flu.html} Obtains information on outpatient inluenza-like-illness from Taiwan National Infectious Disease Statistical System. } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_nidss_flu(regions = "taipei", epiweeks = epirange(201501, 201601)) diff --git a/man/pub_nowcast.Rd b/man/pub_nowcast.Rd index 306c37f1..c300cc8e 100644 --- a/man/pub_nowcast.Rd +++ b/man/pub_nowcast.Rd @@ -7,11 +7,12 @@ pub_nowcast(locations, epiweeks = "*", fetch_args = fetch_args_list()) } \arguments{ -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pub_paho_dengue.Rd b/man/pub_paho_dengue.Rd index 0d643f44..6c5410f4 100644 --- a/man/pub_paho_dengue.Rd +++ b/man/pub_paho_dengue.Rd @@ -14,19 +14,20 @@ pub_paho_dengue( ) } \arguments{ -\item{regions}{character. Regions to fetch.} +\item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{...}{not used for values, forces later arguments to bind by name} -\item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the -most recent issue is returned. Mutually exclusive with \code{lag}.} +\item{issues}{\code{\link{timeset}}. Optionally, the issue(s) of the +data to fetch. See the "Data Versioning" section for details.} -\item{lag}{integer. Optionally, the lag of the issues to fetch. If not set, -the most recent issue is returned. Mutually exclusive with \code{issues}.} +\item{lag}{integer. Optionally, the lag of the issues to fetch. +See the "Data Versioning" section for details.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} @@ -34,6 +35,20 @@ the most recent issue is returned. Mutually exclusive with \code{issues}.} \description{ API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/paho_dengue.html} } +\section{Data Versioning}{ + +Several endpoints support retrieving historical versions of the data. +The following parameters control this and are mutually exclusive (only +one can be provided at a time). +\itemize{ +\item \code{as_of}: (Date) Retrieve the data as it was on this date. +\item \code{issues}: \code{\link{timeset}} Retrieve data from a +specific issue date or range. +\item \code{lag}: (integer) Retrieve data with a specific lag from +its issue date. +} +} + \examples{ \dontrun{ pub_paho_dengue(regions = "ca", epiweeks = epirange(201401, 201501)) diff --git a/man/pub_wiki.Rd b/man/pub_wiki.Rd index 278dca58..30fd30fc 100644 --- a/man/pub_wiki.Rd +++ b/man/pub_wiki.Rd @@ -22,14 +22,15 @@ pub_wiki( \item{time_type}{string. The temporal resolution of the data (either "day" or "week", depending on signal).} -\item{time_values}{\code{\link{timeset}}. Dates or epiweeks to fetch. Defaults to all -("*") dates.} +\item{time_values}{\code{\link{timeset}}. Dates or epiweeks to fetch. +Supports \code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{hours}{integer. Optionally, the hours to fetch.} \item{language}{string. Language to fetch.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pvt_cdc.Rd b/man/pvt_cdc.Rd index 35cc555b..a1b2c14e 100644 --- a/man/pvt_cdc.Rd +++ b/man/pvt_cdc.Rd @@ -7,14 +7,14 @@ pvt_cdc(auth, locations, epiweeks = "*", fetch_args = fetch_args_list()) } \arguments{ -\item{auth}{string. Restricted access key (not the same as API key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. -See \code{fetch_args_list()} for details.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pvt_dengue_sensors.Rd b/man/pvt_dengue_sensors.Rd index 2ff7eb30..52451571 100644 --- a/man/pvt_dengue_sensors.Rd +++ b/man/pvt_dengue_sensors.Rd @@ -13,15 +13,17 @@ pvt_dengue_sensors( ) } \arguments{ -\item{auth}{string. Restricted access key (not the same as API key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{names}{character. Names to fetch.} +\item{names}{character. Names to fetch. +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pvt_ght.Rd b/man/pvt_ght.Rd index 7a16f10c..b4c92102 100644 --- a/man/pvt_ght.Rd +++ b/man/pvt_ght.Rd @@ -7,15 +7,16 @@ pvt_ght(auth, locations, epiweeks = "*", query, fetch_args = fetch_args_list()) } \arguments{ -\item{auth}{string. Restricted access key (not the same as API key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} \item{query}{string. The query to be fetched.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pvt_meta_norostat.Rd b/man/pvt_meta_norostat.Rd index 491c7218..49bac8e5 100644 --- a/man/pvt_meta_norostat.Rd +++ b/man/pvt_meta_norostat.Rd @@ -7,9 +7,10 @@ pvt_meta_norostat(auth, fetch_args = fetch_args_list()) } \arguments{ -\item{auth}{string. Restricted access key (not the same as API key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link{list}} diff --git a/man/pvt_norostat.Rd b/man/pvt_norostat.Rd index 180182e1..7509be4e 100644 --- a/man/pvt_norostat.Rd +++ b/man/pvt_norostat.Rd @@ -7,18 +7,22 @@ pvt_norostat(auth, locations, epiweeks = "*", fetch_args = fetch_args_list()) } \arguments{ -\item{auth}{string. Your authentication key.} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Locations to fetch. Only full state names are +permitted in the list.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} } \description{ +\strong{This endpoind is currently inactive in the Epidata API.} + This is point data only, and does not include minima or maxima. API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/norostat.html} diff --git a/man/pvt_quidel.Rd b/man/pvt_quidel.Rd index 10ca3c0a..1e89edf9 100644 --- a/man/pvt_quidel.Rd +++ b/man/pvt_quidel.Rd @@ -7,13 +7,14 @@ pvt_quidel(auth, locations, epiweeks = "*", fetch_args = fetch_args_list()) } \arguments{ -\item{auth}{string. Restricted access key (not the same as API key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pvt_sensors.Rd b/man/pvt_sensors.Rd index 35e41bf0..9ceb87c3 100644 --- a/man/pvt_sensors.Rd +++ b/man/pvt_sensors.Rd @@ -13,15 +13,17 @@ pvt_sensors( ) } \arguments{ -\item{auth}{string. Restricted access key (not the same as API key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{names}{character. Sensor names to fetch.} +\item{names}{character. Names to fetch. +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Defaults to all ("*") dates.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} diff --git a/man/pvt_twitter.Rd b/man/pvt_twitter.Rd index b6c6e95f..dd955227 100644 --- a/man/pvt_twitter.Rd +++ b/man/pvt_twitter.Rd @@ -14,19 +14,20 @@ pvt_twitter( ) } \arguments{ -\item{auth}{string. Restricted access key (not the same as API key).} +\item{auth}{string. Your restricted access key (not the same as API key).} -\item{locations}{character. Locations to fetch.} +\item{locations}{character. Vector of locations to fetch.} \item{...}{not used for values, forces later arguments to bind by name} \item{time_type}{string. The temporal resolution of the data (either "day" or "week", depending on signal).} -\item{time_values}{\code{\link{timeset}}. Dates or epiweeks to fetch. Defaults to all -("*") dates.} +\item{time_values}{\code{\link{timeset}}. Dates or epiweeks to fetch. +Supports \code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} -\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}.} +\item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass +to \code{fetch()}. See \code{fetch_args_list()} for details.} } \value{ \code{\link[tibble:tibble]{tibble::tibble}} From ead26767d73795c68540ac93cf2473fb77fa4e4a Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 4 Nov 2025 17:41:12 +0000 Subject: [PATCH 04/16] docs: document (GHA) --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ad1d2f35..c32a6132 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -68,7 +68,7 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Collate: 'auth.R' 'avail_endpoints.R' From 1b667ae8f62dcbfe3d9d3caef2d0cdd0c13b2969 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 4 Nov 2025 17:41:50 +0000 Subject: [PATCH 05/16] style: styler (GHA) --- R/endpoints.R | 278 ++++++++++++++++++++++++++---------------------- R/epidatacall.R | 23 ++-- 2 files changed, 163 insertions(+), 138 deletions(-) diff --git a/R/endpoints.R b/R/endpoints.R index fd6e973e..e6df918f 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -61,10 +61,11 @@ NULL #' @keywords endpoint #' @export pvt_cdc <- function( - auth, - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + auth, + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("auth", auth, len = 1) @@ -126,13 +127,14 @@ pvt_cdc <- function( #' @keywords endpoint #' @export pub_covid_hosp_facility_lookup <- function( - ..., - state = NULL, - ccn = NULL, - city = NULL, - zip = NULL, - fips_code = NULL, - fetch_args = fetch_args_list()) { + ..., + state = NULL, + ccn = NULL, + city = NULL, + zip = NULL, + fips_code = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() assert_character_param("state", state, len = 1, required = FALSE) @@ -219,11 +221,12 @@ pub_covid_hosp_facility_lookup <- function( #' @export # pub_covid_hosp_facility <- function( - hospital_pks, - collection_weeks = "*", - ..., - publication_dates = NULL, - fetch_args = fetch_args_list()) { + hospital_pks, + collection_weeks = "*", + ..., + publication_dates = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() collection_weeks <- get_wildcard_equivalent_dates(collection_weeks, "day") @@ -598,12 +601,13 @@ pub_covid_hosp_facility <- function( #' @export # pub_covid_hosp_state_timeseries <- function( - states, - dates = "*", - ..., - as_of = NULL, - issues = NULL, - fetch_args = fetch_args_list()) { + states, + dates = "*", + ..., + as_of = NULL, + issues = NULL, + fetch_args = fetch_args_list() +) { # Check parameters rlang::check_dots_empty() @@ -1002,17 +1006,18 @@ pub_covidcast_meta <- function(fetch_args = fetch_args_list()) { #' @keywords endpoint #' @export pub_covidcast <- function( - source, - signals, - geo_type, - time_type, - geo_values = "*", - time_values = "*", - ..., - as_of = NULL, - issues = NULL, - lag = NULL, - fetch_args = fetch_args_list()) { + source, + signals, + geo_type, + time_type, + geo_values = "*", + time_values = "*", + ..., + as_of = NULL, + issues = NULL, + lag = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() # Check parameters @@ -1117,9 +1122,10 @@ pub_covidcast <- function( #' @keywords endpoint #' @export pub_delphi <- function( - system, - epiweek, - fetch_args = fetch_args_list()) { + system, + epiweek, + fetch_args = fetch_args_list() +) { assert_character_param("system", system) assert_timeset_param("epiweek", epiweek, len = 1) epiweek <- parse_timeset_input(epiweek) @@ -1152,9 +1158,10 @@ pub_delphi <- function( #' @keywords endpoint #' @export pub_dengue_nowcast <- function( - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("locations", locations) @@ -1191,11 +1198,12 @@ pub_dengue_nowcast <- function( #' @keywords endpoint #' @export pvt_dengue_sensors <- function( - auth, - names, - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + auth, + names, + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("auth", auth, len = 1) @@ -1244,12 +1252,13 @@ pvt_dengue_sensors <- function( #' @keywords endpoint #' @export pub_ecdc_ili <- function( - regions, - epiweeks = "*", - ..., - issues = NULL, - lag = NULL, - fetch_args = fetch_args_list()) { + regions, + epiweeks = "*", + ..., + issues = NULL, + lag = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") @@ -1307,12 +1316,13 @@ pub_ecdc_ili <- function( #' @keywords endpoint #' @export pub_flusurv <- function( - locations, - epiweeks = "*", - ..., - issues = NULL, - lag = NULL, - fetch_args = fetch_args_list()) { + locations, + epiweeks = "*", + ..., + issues = NULL, + lag = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") @@ -1370,12 +1380,13 @@ pub_flusurv <- function( #' @keywords endpoint #' @export pub_fluview_clinical <- function( - regions, - epiweeks = "*", - ..., - issues = NULL, - lag = NULL, - fetch_args = fetch_args_list()) { + regions, + epiweeks = "*", + ..., + issues = NULL, + lag = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") @@ -1468,13 +1479,14 @@ pub_fluview_meta <- function(fetch_args = fetch_args_list()) { #' @keywords endpoint #' @export pub_fluview <- function( - regions, - epiweeks = "*", - ..., - issues = NULL, - lag = NULL, - auth = NULL, - fetch_args = fetch_args_list()) { + regions, + epiweeks = "*", + ..., + issues = NULL, + lag = NULL, + auth = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") @@ -1546,9 +1558,10 @@ pub_fluview <- function( #' @keywords endpoint #' @export pub_gft <- function( - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("locations", locations) @@ -1588,11 +1601,12 @@ pub_gft <- function( #' @keywords endpoint #' @export pvt_ght <- function( - auth, - locations, - epiweeks = "*", - query, - fetch_args = fetch_args_list()) { + auth, + locations, + epiweeks = "*", + query, + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("auth", auth, len = 1) @@ -1633,12 +1647,13 @@ pvt_ght <- function( #' @keywords endpoint #' @export pub_kcdc_ili <- function( - regions, - epiweeks = "*", - ..., - issues = NULL, - lag = NULL, - fetch_args = fetch_args_list()) { + regions, + epiweeks = "*", + ..., + issues = NULL, + lag = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") @@ -1731,9 +1746,10 @@ pub_meta <- function(fetch_args = fetch_args_list()) { #' @keywords endpoint #' @export pub_nidss_dengue <- function( - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("locations", locations) @@ -1771,12 +1787,13 @@ pub_nidss_dengue <- function( #' @keywords endpoint #' @export pub_nidss_flu <- function( - regions, - epiweeks = "*", - ..., - issues = NULL, - lag = NULL, - fetch_args = fetch_args_list()) { + regions, + epiweeks = "*", + ..., + issues = NULL, + lag = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") @@ -1839,10 +1856,11 @@ pub_nidss_flu <- function( #' @keywords endpoint #' @export pvt_norostat <- function( - auth, - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + auth, + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("auth", auth, len = 1) @@ -1883,9 +1901,10 @@ pvt_norostat <- function( #' @keywords endpoint #' @export pub_nowcast <- function( - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("locations", locations) @@ -1920,12 +1939,13 @@ pub_nowcast <- function( #' @keywords endpoint #' @export pub_paho_dengue <- function( - regions, - epiweeks = "*", - ..., - issues = NULL, - lag = NULL, - fetch_args = fetch_args_list()) { + regions, + epiweeks = "*", + ..., + issues = NULL, + lag = NULL, + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") @@ -1980,10 +2000,11 @@ pub_paho_dengue <- function( #' @keywords endpoint #' @export pvt_quidel <- function( - auth, - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + auth, + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("auth", auth, len = 1) @@ -2035,11 +2056,12 @@ pvt_quidel <- function( #' @keywords endpoint #' @export pvt_sensors <- function( - auth, - names, - locations, - epiweeks = "*", - fetch_args = fetch_args_list()) { + auth, + names, + locations, + epiweeks = "*", + fetch_args = fetch_args_list() +) { epiweeks <- get_wildcard_equivalent_dates(epiweeks, "week") assert_character_param("auth", auth, len = 1) @@ -2087,12 +2109,13 @@ pvt_sensors <- function( #' @keywords endpoint #' @export pvt_twitter <- function( - auth, - locations, - ..., - time_type = c("day", "week"), - time_values = "*", - fetch_args = fetch_args_list()) { + auth, + locations, + ..., + time_type = c("day", "week"), + time_values = "*", + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() time_type <- match.arg(time_type) @@ -2166,13 +2189,14 @@ pvt_twitter <- function( #' @keywords endpoint #' @export pub_wiki <- function( - articles, - ..., - time_type = c("day", "week"), - time_values = "*", - hours = NULL, - language = "en", - fetch_args = fetch_args_list()) { + articles, + ..., + time_type = c("day", "week"), + time_values = "*", + hours = NULL, + language = "en", + fetch_args = fetch_args_list() +) { rlang::check_dots_empty() time_type <- match.arg(time_type) diff --git a/R/epidatacall.R b/R/epidatacall.R index c97a6d16..cd3c06b4 100644 --- a/R/epidatacall.R +++ b/R/epidatacall.R @@ -161,17 +161,18 @@ print.epidata_call <- function(x, ...) { #' @aliases fetch_args #' @importFrom checkmate assert_character assert_logical assert_numeric fetch_args_list <- function( - ..., - fields = NULL, - disable_date_parsing = FALSE, - disable_data_frame_parsing = FALSE, - return_empty = FALSE, - timeout_seconds = 15 * 60, - base_url = NULL, - dry_run = FALSE, - debug = FALSE, - format_type = c("json", "classic", "csv"), - refresh_cache = FALSE) { + ..., + fields = NULL, + disable_date_parsing = FALSE, + disable_data_frame_parsing = FALSE, + return_empty = FALSE, + timeout_seconds = 15 * 60, + base_url = NULL, + dry_run = FALSE, + debug = FALSE, + format_type = c("json", "classic", "csv"), + refresh_cache = FALSE +) { rlang::check_dots_empty() assert_character(fields, null.ok = TRUE, any.missing = FALSE) From 81f410a5a187a40f346a7e723e726f83fda6944b Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 4 Nov 2025 10:03:47 -0800 Subject: [PATCH 06/16] fix: Add @keywords internal to .epidatr_shared_params This change prevents issues with referencing .epidatr_shared_params when building the documentation site. --- R/endpoints.R | 1 + man/covidcast_epidata.Rd | 4 ++-- man/dot-epidatr_shared_params.Rd | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/endpoints.R b/R/endpoints.R index e6df918f..b37c889c 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -3,6 +3,7 @@ #' @description This is a central text for parameter documentation #' #' @name .epidatr_shared_params +#' @keywords internal #' #' @param auth string. Your restricted access key (not the same as API key). #' @param locations character. Vector of locations to fetch. diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index e3a997a8..158d8008 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 508 x 3 +#> # A tibble: 526 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 498 more rows +#> # i 516 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type diff --git a/man/dot-epidatr_shared_params.Rd b/man/dot-epidatr_shared_params.Rd index eb6e4cb2..b0f9286d 100644 --- a/man/dot-epidatr_shared_params.Rd +++ b/man/dot-epidatr_shared_params.Rd @@ -57,3 +57,4 @@ its issue date. } } +\keyword{internal} From b7082fd1023aa43bb05edbb3b362211364b4b0b2 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 4 Nov 2025 18:12:14 +0000 Subject: [PATCH 07/16] docs: document (GHA) --- man/covidcast_epidata.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index 158d8008..e3a997a8 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 526 x 3 +#> # A tibble: 508 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 516 more rows +#> # i 498 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type From 3bf497c7ef2431ebf8500d40cc2131fedc82c984 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 4 Nov 2025 10:51:25 -0800 Subject: [PATCH 08/16] docs: point out valid lists of locations. This closes essue #287. --- R/endpoints.R | 7 +++---- man/covidcast_epidata.Rd | 4 ++-- man/pvt_norostat.Rd | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/R/endpoints.R b/R/endpoints.R index b37c889c..8d35b566 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -1833,8 +1833,6 @@ pub_nidss_flu <- function( #' CDC NoroSTAT norovirus outbreaks #' @description -#' \strong{This endpoind is currently inactive in the Epidata API.} -#' #' This is point data only, and does not include minima or maxima. #' #' API docs: @@ -1851,8 +1849,9 @@ pub_nidss_flu <- function( #' ) #' } #' @inheritParams .epidatr_shared_params -#' @param locations character. Locations to fetch. Only full state names are -#' permitted in the list. +#' @param locations character. Locations to fetch. Only a specific list of +#' full state names are permitted. See the `locations` column in the +#' output of `pvt_meta_norostat()` for the allowed values. #' @return [`tibble::tibble`] #' @keywords endpoint #' @export diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index e3a997a8..158d8008 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 508 x 3 +#> # A tibble: 526 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 498 more rows +#> # i 516 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type diff --git a/man/pvt_norostat.Rd b/man/pvt_norostat.Rd index 7509be4e..fd06f5ec 100644 --- a/man/pvt_norostat.Rd +++ b/man/pvt_norostat.Rd @@ -9,8 +9,9 @@ pvt_norostat(auth, locations, epiweeks = "*", fetch_args = fetch_args_list()) \arguments{ \item{auth}{string. Your restricted access key (not the same as API key).} -\item{locations}{character. Locations to fetch. Only full state names are -permitted in the list.} +\item{locations}{character. Locations to fetch. Only a specific list of +full state names are permitted. See the \code{locations} column in the +output of \code{pvt_meta_norostat()} for the allowed values.} \item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} @@ -21,8 +22,6 @@ to \code{fetch()}. See \code{fetch_args_list()} for details.} \code{\link[tibble:tibble]{tibble::tibble}} } \description{ -\strong{This endpoind is currently inactive in the Epidata API.} - This is point data only, and does not include minima or maxima. API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/norostat.html} From f33ffb243a950373291c17d5a090aec7a8423c8b Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 4 Nov 2025 19:04:23 +0000 Subject: [PATCH 09/16] docs: document (GHA) --- man/covidcast_epidata.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index 158d8008..e3a997a8 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 526 x 3 +#> # A tibble: 508 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 516 more rows +#> # i 498 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type From 9e2817a520a468fb47a9f97d2bedc4864eda5029 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Fri, 7 Nov 2025 11:09:14 -0800 Subject: [PATCH 10/16] docs: It adds conditions to run the examples to replace `\dontrun` It solves #208. --- DESCRIPTION | 3 +- R/endpoints.R | 142 ++++++++++++------------- R/epidatacall.R | 6 +- R/request.R | 6 +- man/covidcast_epidata.Rd | 4 +- man/do_request.Rd | 5 +- man/epidata_call.Rd | 7 +- man/pub_covid_hosp_facility.Rd | 5 +- man/pub_covid_hosp_facility_lookup.Rd | 5 +- man/pub_covid_hosp_state_timeseries.Rd | 5 +- man/pub_covidcast.Rd | 6 +- man/pub_covidcast_meta.Rd | 6 +- man/pub_dengue_nowcast.Rd | 5 +- man/pub_ecdc_ili.Rd | 5 +- man/pub_fluview.Rd | 5 +- man/pub_fluview_clinical.Rd | 7 +- man/pub_fluview_meta.Rd | 5 +- man/pub_gft.Rd | 5 +- man/pub_kcdc_ili.Rd | 5 +- man/pub_nidss_dengue.Rd | 5 +- man/pub_nidss_flu.Rd | 5 +- man/pub_nowcast.Rd | 5 +- man/pub_paho_dengue.Rd | 5 +- man/pub_wiki.Rd | 5 +- man/pvt_cdc.Rd | 5 +- man/pvt_dengue_sensors.Rd | 5 +- man/pvt_ght.Rd | 5 +- man/pvt_norostat.Rd | 5 +- man/pvt_quidel.Rd | 5 +- man/pvt_sensors.Rd | 5 +- man/pvt_twitter.Rd | 5 +- 31 files changed, 158 insertions(+), 139 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c32a6132..b4f195bf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -57,7 +57,8 @@ Suggests: readr, rmarkdown, testthat (>= 3.1.5), - withr + withr, + curl VignetteBuilder: knitr Remotes: diff --git a/R/endpoints.R b/R/endpoints.R index 8d35b566..2f9caca0 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -47,14 +47,12 @@ NULL #' @description #' API docs: #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("SECRET_API_AUTH_CDC") != "" #' pvt_cdc( #' auth = Sys.getenv("SECRET_API_AUTH_CDC"), #' locations = "fl,ca", #' epirange(201501, 201601) #' ) -#' } #' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] @@ -111,11 +109,11 @@ pvt_cdc <- function( #' @details Only one location argument needs to be specified. #' Combinations of the arguments are not currently supported. #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_covid_hosp_facility_lookup(state = "fl") #' pub_covid_hosp_facility_lookup(city = "southlake") -#' } +#' #' @inheritParams .epidatr_shared_params #' @param state string. A two-letter character state abbreviation. #' @param ccn string. A facility CMS certification number. @@ -196,8 +194,8 @@ pub_covid_hosp_facility_lookup <- function( #' @details Starting October 1, 2022, some facilities are only required to #' report annually. #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_covid_hosp_facility( #' hospital_pks = "100075", #' collection_weeks = epirange(20200101, 20200501) @@ -207,7 +205,7 @@ pub_covid_hosp_facility_lookup <- function( #' hospital_pks = "050063", #' collection_weeks = epirange(20240101, 20240301) #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @param hospital_pks character. Facility identifiers. #' @param collection_weeks [`timeset`]. Dates (corresponding to epiweeks) to @@ -584,13 +582,13 @@ pub_covid_hosp_facility <- function( #' @details Starting October 1, 2022, some facilities are only required to #' report annually. #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_covid_hosp_state_timeseries( #' states = "fl", #' dates = epirange(20200101, 20200501) #' ) -#' } +#' #' #' @inheritParams .epidatr_shared_params #' @@ -920,10 +918,9 @@ pub_covid_hosp_state_timeseries <- function( #' #' @return [`tibble::tibble`] #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_covidcast_meta() -#' } #' #' @seealso [pub_covidcast()],[covidcast_epidata()] #' @keywords endpoint @@ -969,8 +966,8 @@ pub_covidcast_meta <- function(fetch_args = fetch_args_list()) { #' link above for more. Delphi's [COVIDcast public #' dashboard](https://delphi.cmu.edu/covidcast/) is powered by this endpoint. #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_covidcast( #' source = "jhu-csse", #' signals = "confirmed_7dav_incidence_prop", @@ -987,7 +984,6 @@ pub_covidcast_meta <- function(fetch_args = fetch_args_list()) { #' geo_values = "*", #' time_values = epirange(20200601, 20200801) #' ) -#' } #' #' @inheritParams .epidatr_shared_params #' @param source string. The data source to query (see: @@ -1147,13 +1143,13 @@ pub_delphi <- function( #' @description #' API docs: #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_dengue_nowcast( #' locations = "pr", #' epiweeks = epirange(201401, 202301) #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint @@ -1185,15 +1181,15 @@ pub_dengue_nowcast <- function( #' @description #' API docs: #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("SECRET_API_AUTH_SENSORS") != "" +#' #' pvt_dengue_sensors( #' auth = Sys.getenv("SECRET_API_AUTH_SENSORS"), #' names = "ght", #' locations = "ag", #' epiweeks = epirange(201501, 202001) #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint @@ -1241,10 +1237,10 @@ pvt_dengue_sensors <- function( #' @details The list of location argument can be found in #' . #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_ecdc_ili(regions = "austria", epiweeks = epirange(201901, 202001)) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @@ -1366,10 +1362,10 @@ pub_flusurv <- function( #' @description #' API docs: #' -#' @examples -#' \dontrun{ -#' pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) -#' } +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' +#' pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) +#' #' @inheritParams .epidatr_shared_params #' @param regions character. Locations to fetch. Can be any string IDs in #' national, HHS region, census division, most states and territories, and so @@ -1430,10 +1426,10 @@ pub_fluview_clinical <- function( #' @description #' API docs: #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_fluview_meta() -#' } +#' #' #' @inheritParams .epidatr_shared_params #' @@ -1467,10 +1463,10 @@ pub_fluview_meta <- function(fetch_args = fetch_args_list()) { #' @details The full list of location inputs can be accessed at #' . #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_fluview(regions = "nat", epiweeks = epirange(201201, 202005)) -#' } +#' #' @inheritParams .epidatr_shared_params #' @inheritParams pub_fluview_clinical #' @return [`tibble::tibble`] @@ -1549,10 +1545,10 @@ pub_fluview <- function( #' and #' . #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_gft(locations = "hhs1", epiweeks = epirange(201201, 202001)) -#' } +#' #' @inheritParams .epidatr_shared_params #' #' @return [`tibble::tibble`] @@ -1587,15 +1583,15 @@ pub_gft <- function( #' #' Estimate of influenza activity based on volume of certain search queries. … #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("SECRET_API_AUTH_GHT") != "" +#' #' pvt_ght( #' auth = Sys.getenv("SECRET_API_AUTH_GHT"), #' locations = "ma", #' epiweeks = epirange(199301, 202304), #' query = "how to get over the flu" #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @param query string. The query to be fetched. #' @return [`tibble::tibble`] @@ -1636,10 +1632,10 @@ pvt_ght <- function( #' @description #' API docs: #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_kcdc_ili(regions = "ROK", epiweeks = 200436) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @@ -1737,10 +1733,10 @@ pub_meta <- function(fetch_args = fetch_args_list()) { #' and #' . #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_nidss_dengue(locations = "taipei", epiweeks = epirange(201201, 201301)) -#' } +#' #' @inheritParams .epidatr_shared_params #' #' @return [`tibble::tibble`] @@ -1776,10 +1772,10 @@ pub_nidss_dengue <- function( #' Infectious Disease Statistical System. #' #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_nidss_flu(regions = "taipei", epiweeks = epirange(201501, 201601)) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @@ -1840,14 +1836,14 @@ pub_nidss_flu <- function( #' This is the documentation of the API for accessing the NoroSTAT endpoint of #' the Delphi’s epidemiological data. #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("SECRET_API_AUTH_NOROSTAT") != "" +#' #' pvt_norostat( #' auth = Sys.getenv("SECRET_API_AUTH_NOROSTAT"), #' locations = "Minnesota, Ohio, Oregon, Tennessee, and Wisconsin", #' epiweeks = 201233 #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @param locations character. Locations to fetch. Only a specific list of #' full state names are permitted. See the `locations` column in the @@ -1892,10 +1888,10 @@ pvt_norostat <- function( #' @details The full list of location inputs can be accessed at #' . #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_nowcast(locations = "ca", epiweeks = epirange(201201, 201301)) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint @@ -1927,10 +1923,10 @@ pub_nowcast <- function( #' @description #' API docs: #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_paho_dengue(regions = "ca", epiweeks = epirange(201401, 201501)) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @@ -1987,14 +1983,14 @@ pub_paho_dengue <- function( #' #' Data provided by Quidel Corp., which contains flu lab test results. #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("SECRET_API_AUTH_QUIDEL") != "" +#' #' pvt_quidel( #' auth = Sys.getenv("SECRET_API_AUTH_QUIDEL"), #' epiweeks = epirange(201201, 202001), #' locations = "hhs1" #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint @@ -2042,15 +2038,15 @@ pvt_quidel <- function( #' these were designed to track ILI as driven by seasonal influenza, and were #' NOT designed to track ILI during the COVID-19 pandemic. #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("SECRET_API_AUTH_SENSORS") != "" +#' #' pvt_sensors( #' auth = Sys.getenv("SECRET_API_AUTH_SENSORS"), #' names = "sar3", #' locations = "nat", #' epiweeks = epirange(201501, 202001) #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint @@ -2095,15 +2091,15 @@ pvt_sensors <- function( #' Delphi’s epidemiological data. Sourced from #' [Healthtweets](http://www.healthtweets.org/) #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("SECRET_API_AUTH_TWITTER") != "" +#' #' pvt_twitter( #' auth = Sys.getenv("SECRET_API_AUTH_TWITTER"), #' locations = "CA", #' time_type = "week", #' time_values = epirange(201501, 202001) #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' @keywords endpoint @@ -2173,14 +2169,14 @@ pvt_twitter <- function( #' * Other resolution: By article (54) #' * Open access #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' pub_wiki( #' articles = "avian_influenza", #' time_type = "week", #' time_values = epirange(201501, 201601) #' ) -#' } +#' #' @inheritParams .epidatr_shared_params #' @param articles character. Articles to fetch. #' @param language string. Language to fetch. diff --git a/R/epidatacall.R b/R/epidatacall.R index cd3c06b4..fcc3611a 100644 --- a/R/epidatacall.R +++ b/R/epidatacall.R @@ -19,8 +19,9 @@ #' `request_url` (for debugging): outputs the request URL from which data #' would be fetched (note additional parameters below) #' -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' library(magrittr) +#' #' call <- pub_covidcast( #' source = "jhu-csse", #' signals = "confirmed_7dav_incidence_prop", @@ -31,7 +32,6 @@ #' fetch_args = fetch_args_list(dry_run = TRUE) #' ) #' call %>% fetch() -#' } #' #' @param endpoint the epidata endpoint to call #' @param params the parameters to pass to the epidata endpoint diff --git a/R/request.R b/R/request.R index 603e7bd3..56a83d88 100644 --- a/R/request.R +++ b/R/request.R @@ -8,8 +8,8 @@ join_url <- function(url, endpoint) { #' performs the request #' #' You can test the authentication headers like so: -#' @examples -#' \dontrun{ +#' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" +#' #' response <- httr::RETRY( #' "GET", "https://httpbin.org/headers", #' httr::authenticate("epidata", "fake_key") @@ -18,7 +18,7 @@ join_url <- function(url, endpoint) { #' "Basic ", #' base64enc::base64encode(charToRaw("epidata:fake_key")) #' ) -#' } +#' #' #' @importFrom httr RETRY #' @keywords internal diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index e3a997a8..158d8008 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 508 x 3 +#> # A tibble: 526 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 498 more rows +#> # i 516 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type diff --git a/man/do_request.Rd b/man/do_request.Rd index e5cd7995..ae01057b 100644 --- a/man/do_request.Rd +++ b/man/do_request.Rd @@ -10,7 +10,8 @@ do_request(url, params, timeout_seconds) You can test the authentication headers like so: } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + response <- httr::RETRY( "GET", "https://httpbin.org/headers", httr::authenticate("epidata", "fake_key") @@ -19,7 +20,7 @@ content(response)$headers$Authorization == paste0( "Basic ", base64enc::base64encode(charToRaw("epidata:fake_key")) ) -} +\dontshow{\}) # examplesIf} } \keyword{internal} diff --git a/man/epidata_call.Rd b/man/epidata_call.Rd index c2ef4b6b..8d8456ef 100644 --- a/man/epidata_call.Rd +++ b/man/epidata_call.Rd @@ -60,7 +60,9 @@ endpoints only support the JSON classic format (\code{pub_delphi}, JSON-like nested list structure is returned instead. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} +library(magrittr) + call <- pub_covidcast( source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", @@ -71,6 +73,5 @@ call <- pub_covidcast( fetch_args = fetch_args_list(dry_run = TRUE) ) call \%>\% fetch() -} - +\dontshow{\}) # examplesIf} } diff --git a/man/pub_covid_hosp_facility.Rd b/man/pub_covid_hosp_facility.Rd index 65bec6c7..c326cc6f 100644 --- a/man/pub_covid_hosp_facility.Rd +++ b/man/pub_covid_hosp_facility.Rd @@ -42,7 +42,8 @@ Starting October 1, 2022, some facilities are only required to report annually. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_covid_hosp_facility( hospital_pks = "100075", collection_weeks = epirange(20200101, 20200501) @@ -52,7 +53,7 @@ pub_covid_hosp_facility( hospital_pks = "050063", collection_weeks = epirange(20240101, 20240301) ) -} +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=pub_covid_hosp_facility]{pub_covid_hosp_facility()}}, \code{\link[=epirange]{epirange()}} diff --git a/man/pub_covid_hosp_facility_lookup.Rd b/man/pub_covid_hosp_facility_lookup.Rd index 1451a949..06d7f80b 100644 --- a/man/pub_covid_hosp_facility_lookup.Rd +++ b/man/pub_covid_hosp_facility_lookup.Rd @@ -46,10 +46,11 @@ Only one location argument needs to be specified. Combinations of the arguments are not currently supported. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_covid_hosp_facility_lookup(state = "fl") pub_covid_hosp_facility_lookup(city = "southlake") -} +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=pub_covid_hosp_facility]{pub_covid_hosp_facility()}} diff --git a/man/pub_covid_hosp_state_timeseries.Rd b/man/pub_covid_hosp_state_timeseries.Rd index bd5afd9d..0fefc532 100644 --- a/man/pub_covid_hosp_state_timeseries.Rd +++ b/man/pub_covid_hosp_state_timeseries.Rd @@ -59,12 +59,13 @@ its issue date. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_covid_hosp_state_timeseries( states = "fl", dates = epirange(20200101, 20200501) ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_covidcast.Rd b/man/pub_covidcast.Rd index 0895365d..82328f0a 100644 --- a/man/pub_covidcast.Rd +++ b/man/pub_covidcast.Rd @@ -77,7 +77,8 @@ its issue date. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_covidcast( source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", @@ -94,8 +95,7 @@ pub_covidcast( geo_values = "*", time_values = epirange(20200601, 20200801) ) -} - +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=pub_covidcast_meta]{pub_covidcast_meta()}}, \code{\link[=covidcast_epidata]{covidcast_epidata()}}, \code{\link[=epirange]{epirange()}} diff --git a/man/pub_covidcast_meta.Rd b/man/pub_covidcast_meta.Rd index a5ef892a..395f5e2c 100644 --- a/man/pub_covidcast_meta.Rd +++ b/man/pub_covidcast_meta.Rd @@ -22,10 +22,10 @@ the API, along with basic summary statistics such as the dates they are available, the geographic levels at which they are reported, and etc. } \examples{ -\dontrun{ -pub_covidcast_meta() -} +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} +pub_covidcast_meta() +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=pub_covidcast]{pub_covidcast()}},\code{\link[=covidcast_epidata]{covidcast_epidata()}} diff --git a/man/pub_dengue_nowcast.Rd b/man/pub_dengue_nowcast.Rd index 9f4ac4e0..1e6bda5f 100644 --- a/man/pub_dengue_nowcast.Rd +++ b/man/pub_dengue_nowcast.Rd @@ -21,11 +21,12 @@ to \code{fetch()}. See \code{fetch_args_list()} for details.} API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/dengue_nowcast.html} } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_dengue_nowcast( locations = "pr", epiweeks = epirange(201401, 202301) ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_ecdc_ili.Rd b/man/pub_ecdc_ili.Rd index 7c1b380a..ab85d19b 100644 --- a/man/pub_ecdc_ili.Rd +++ b/man/pub_ecdc_ili.Rd @@ -57,8 +57,9 @@ its issue date. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_ecdc_ili(regions = "austria", epiweeks = epirange(201901, 202001)) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_fluview.Rd b/man/pub_fluview.Rd index 1b599498..2ec8cf29 100644 --- a/man/pub_fluview.Rd +++ b/man/pub_fluview.Rd @@ -63,8 +63,9 @@ its issue date. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_fluview(regions = "nat", epiweeks = epirange(201201, 202005)) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_fluview_clinical.Rd b/man/pub_fluview_clinical.Rd index 318ab808..61183feb 100644 --- a/man/pub_fluview_clinical.Rd +++ b/man/pub_fluview_clinical.Rd @@ -52,8 +52,9 @@ its issue date. } \examples{ -\dontrun{ -pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) -} +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + + pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_fluview_meta.Rd b/man/pub_fluview_meta.Rd index 39e14e7a..65f600dc 100644 --- a/man/pub_fluview_meta.Rd +++ b/man/pub_fluview_meta.Rd @@ -17,10 +17,11 @@ to \code{fetch()}. See \code{fetch_args_list()} for details.} API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/fluview_meta.html} } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_fluview_meta() -} +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=pub_fluview]{pub_fluview()}} diff --git a/man/pub_gft.Rd b/man/pub_gft.Rd index ecfbc23f..723f85d7 100644 --- a/man/pub_gft.Rd +++ b/man/pub_gft.Rd @@ -32,8 +32,9 @@ and \url{https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/cities.txt}. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_gft(locations = "hhs1", epiweeks = epirange(201201, 202001)) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_kcdc_ili.Rd b/man/pub_kcdc_ili.Rd index c143a845..d4bb6646 100644 --- a/man/pub_kcdc_ili.Rd +++ b/man/pub_kcdc_ili.Rd @@ -50,8 +50,9 @@ its issue date. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_kcdc_ili(regions = "ROK", epiweeks = 200436) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_nidss_dengue.Rd b/man/pub_nidss_dengue.Rd index 7a51cff4..42e3c3e9 100644 --- a/man/pub_nidss_dengue.Rd +++ b/man/pub_nidss_dengue.Rd @@ -30,8 +30,9 @@ and \url{https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/nidss_locations.txt}. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_nidss_dengue(locations = "taipei", epiweeks = epirange(201201, 201301)) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_nidss_flu.Rd b/man/pub_nidss_flu.Rd index 41ec40f3..134d86aa 100644 --- a/man/pub_nidss_flu.Rd +++ b/man/pub_nidss_flu.Rd @@ -53,8 +53,9 @@ its issue date. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_nidss_flu(regions = "taipei", epiweeks = epirange(201501, 201601)) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_nowcast.Rd b/man/pub_nowcast.Rd index c300cc8e..398877cc 100644 --- a/man/pub_nowcast.Rd +++ b/man/pub_nowcast.Rd @@ -27,8 +27,9 @@ The full list of location inputs can be accessed at \url{https://github.com/cmu-delphi/delphi-epidata/blob/main/src/acquisition/fluview/fluview_locations.py}. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_nowcast(locations = "ca", epiweeks = epirange(201201, 201301)) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_paho_dengue.Rd b/man/pub_paho_dengue.Rd index 6c5410f4..23c35ace 100644 --- a/man/pub_paho_dengue.Rd +++ b/man/pub_paho_dengue.Rd @@ -50,8 +50,9 @@ its issue date. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_paho_dengue(regions = "ca", epiweeks = epirange(201401, 201501)) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_wiki.Rd b/man/pub_wiki.Rd index 30fd30fc..b40746c8 100644 --- a/man/pub_wiki.Rd +++ b/man/pub_wiki.Rd @@ -47,12 +47,13 @@ Number of page visits for selected English, Influenza-related wikipedia articles } } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} + pub_wiki( articles = "avian_influenza", time_type = "week", time_values = epirange(201501, 201601) ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pvt_cdc.Rd b/man/pvt_cdc.Rd index a1b2c14e..7e546732 100644 --- a/man/pvt_cdc.Rd +++ b/man/pvt_cdc.Rd @@ -23,13 +23,12 @@ to \code{fetch()}. See \code{fetch_args_list()} for details.} API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/cdc.html} } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("SECRET_API_AUTH_CDC") != "") withAutoprint(\{ # examplesIf} pvt_cdc( auth = Sys.getenv("SECRET_API_AUTH_CDC"), locations = "fl,ca", epirange(201501, 201601) ) -} - +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pvt_dengue_sensors.Rd b/man/pvt_dengue_sensors.Rd index 52451571..3cc9a7b6 100644 --- a/man/pvt_dengue_sensors.Rd +++ b/man/pvt_dengue_sensors.Rd @@ -32,13 +32,14 @@ to \code{fetch()}. See \code{fetch_args_list()} for details.} API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/dengue_sensors.html} } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("SECRET_API_AUTH_SENSORS") != "") withAutoprint(\{ # examplesIf} + pvt_dengue_sensors( auth = Sys.getenv("SECRET_API_AUTH_SENSORS"), names = "ght", locations = "ag", epiweeks = epirange(201501, 202001) ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pvt_ght.Rd b/man/pvt_ght.Rd index b4c92102..3758eda6 100644 --- a/man/pvt_ght.Rd +++ b/man/pvt_ght.Rd @@ -27,13 +27,14 @@ API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/ght.html} Estimate of influenza activity based on volume of certain search queries. … } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("SECRET_API_AUTH_GHT") != "") withAutoprint(\{ # examplesIf} + pvt_ght( auth = Sys.getenv("SECRET_API_AUTH_GHT"), locations = "ma", epiweeks = epirange(199301, 202304), query = "how to get over the flu" ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pvt_norostat.Rd b/man/pvt_norostat.Rd index fd06f5ec..d2b8787d 100644 --- a/man/pvt_norostat.Rd +++ b/man/pvt_norostat.Rd @@ -30,12 +30,13 @@ This is the documentation of the API for accessing the NoroSTAT endpoint of the Delphi’s epidemiological data. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("SECRET_API_AUTH_NOROSTAT") != "") withAutoprint(\{ # examplesIf} + pvt_norostat( auth = Sys.getenv("SECRET_API_AUTH_NOROSTAT"), locations = "Minnesota, Ohio, Oregon, Tennessee, and Wisconsin", epiweeks = 201233 ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pvt_quidel.Rd b/man/pvt_quidel.Rd index 1e89edf9..5e8041c5 100644 --- a/man/pvt_quidel.Rd +++ b/man/pvt_quidel.Rd @@ -25,12 +25,13 @@ API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/quidel.html} Data provided by Quidel Corp., which contains flu lab test results. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("SECRET_API_AUTH_QUIDEL") != "") withAutoprint(\{ # examplesIf} + pvt_quidel( auth = Sys.getenv("SECRET_API_AUTH_QUIDEL"), epiweeks = epirange(201201, 202001), locations = "hhs1" ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pvt_sensors.Rd b/man/pvt_sensors.Rd index 9ceb87c3..e8478901 100644 --- a/man/pvt_sensors.Rd +++ b/man/pvt_sensors.Rd @@ -43,13 +43,14 @@ these were designed to track ILI as driven by seasonal influenza, and were NOT designed to track ILI during the COVID-19 pandemic. } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("SECRET_API_AUTH_SENSORS") != "") withAutoprint(\{ # examplesIf} + pvt_sensors( auth = Sys.getenv("SECRET_API_AUTH_SENSORS"), names = "sar3", locations = "nat", epiweeks = epirange(201501, 202001) ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pvt_twitter.Rd b/man/pvt_twitter.Rd index dd955227..72d7c154 100644 --- a/man/pvt_twitter.Rd +++ b/man/pvt_twitter.Rd @@ -40,13 +40,14 @@ Delphi’s epidemiological data. Sourced from \href{http://www.healthtweets.org/}{Healthtweets} } \examples{ -\dontrun{ +\dontshow{if (curl::has_internet() && Sys.getenv("SECRET_API_AUTH_TWITTER") != "") withAutoprint(\{ # examplesIf} + pvt_twitter( auth = Sys.getenv("SECRET_API_AUTH_TWITTER"), locations = "CA", time_type = "week", time_values = epirange(201501, 202001) ) -} +\dontshow{\}) # examplesIf} } \keyword{endpoint} From 0b744e675dd96ef6777d782c04443856c2aa0fd3 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Fri, 7 Nov 2025 11:14:38 -0800 Subject: [PATCH 11/16] docs: fix epiweeks that got cut off --- R/endpoints.R | 1 + man/dot-epidatr_shared_params.Rd | 3 ++- man/pub_dengue_nowcast.Rd | 3 ++- man/pub_ecdc_ili.Rd | 3 ++- man/pub_flusurv.Rd | 3 ++- man/pub_fluview.Rd | 3 ++- man/pub_fluview_clinical.Rd | 3 ++- man/pub_gft.Rd | 3 ++- man/pub_kcdc_ili.Rd | 3 ++- man/pub_nidss_dengue.Rd | 3 ++- man/pub_nidss_flu.Rd | 3 ++- man/pub_nowcast.Rd | 3 ++- man/pub_paho_dengue.Rd | 3 ++- man/pvt_cdc.Rd | 3 ++- man/pvt_dengue_sensors.Rd | 3 ++- man/pvt_ght.Rd | 3 ++- man/pvt_norostat.Rd | 3 ++- man/pvt_quidel.Rd | 3 ++- man/pvt_sensors.Rd | 3 ++- 19 files changed, 37 insertions(+), 18 deletions(-) diff --git a/R/endpoints.R b/R/endpoints.R index 2f9caca0..1285231d 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -10,6 +10,7 @@ #' @param states character. Two letter state abbreviations. #' @param regions character. Vector of regions to fetch. #' @param epiweeks [`timeset`]. Epiweeks to fetch. Supports +#' [`epirange()`] and defaults to all ("*") dates. #' @param time_type string. The temporal resolution of the data (either "day" or #' "week", depending on signal). #' @param names character. Names to fetch. diff --git a/man/dot-epidatr_shared_params.Rd b/man/dot-epidatr_shared_params.Rd index b0f9286d..3f48d5da 100644 --- a/man/dot-epidatr_shared_params.Rd +++ b/man/dot-epidatr_shared_params.Rd @@ -12,7 +12,8 @@ \item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{time_type}{string. The temporal resolution of the data (either "day" or "week", depending on signal).} diff --git a/man/pub_dengue_nowcast.Rd b/man/pub_dengue_nowcast.Rd index 1e6bda5f..8bf5ad91 100644 --- a/man/pub_dengue_nowcast.Rd +++ b/man/pub_dengue_nowcast.Rd @@ -9,7 +9,8 @@ pub_dengue_nowcast(locations, epiweeks = "*", fetch_args = fetch_args_list()) \arguments{ \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pub_ecdc_ili.Rd b/man/pub_ecdc_ili.Rd index ab85d19b..e2d5b883 100644 --- a/man/pub_ecdc_ili.Rd +++ b/man/pub_ecdc_ili.Rd @@ -16,7 +16,8 @@ pub_ecdc_ili( \arguments{ \item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} diff --git a/man/pub_flusurv.Rd b/man/pub_flusurv.Rd index dd0c007b..ce573c23 100644 --- a/man/pub_flusurv.Rd +++ b/man/pub_flusurv.Rd @@ -16,7 +16,8 @@ pub_flusurv( \arguments{ \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} diff --git a/man/pub_fluview.Rd b/man/pub_fluview.Rd index 2ec8cf29..433fbefc 100644 --- a/man/pub_fluview.Rd +++ b/man/pub_fluview.Rd @@ -17,7 +17,8 @@ pub_fluview( \arguments{ \item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} diff --git a/man/pub_fluview_clinical.Rd b/man/pub_fluview_clinical.Rd index 61183feb..5867a877 100644 --- a/man/pub_fluview_clinical.Rd +++ b/man/pub_fluview_clinical.Rd @@ -18,7 +18,8 @@ pub_fluview_clinical( national, HHS region, census division, most states and territories, and so on. Full list link below.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} diff --git a/man/pub_gft.Rd b/man/pub_gft.Rd index 723f85d7..608984ee 100644 --- a/man/pub_gft.Rd +++ b/man/pub_gft.Rd @@ -9,7 +9,8 @@ pub_gft(locations, epiweeks = "*", fetch_args = fetch_args_list()) \arguments{ \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pub_kcdc_ili.Rd b/man/pub_kcdc_ili.Rd index d4bb6646..17e58186 100644 --- a/man/pub_kcdc_ili.Rd +++ b/man/pub_kcdc_ili.Rd @@ -16,7 +16,8 @@ pub_kcdc_ili( \arguments{ \item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} diff --git a/man/pub_nidss_dengue.Rd b/man/pub_nidss_dengue.Rd index 42e3c3e9..3ed07b73 100644 --- a/man/pub_nidss_dengue.Rd +++ b/man/pub_nidss_dengue.Rd @@ -9,7 +9,8 @@ pub_nidss_dengue(locations, epiweeks = "*", fetch_args = fetch_args_list()) \arguments{ \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pub_nidss_flu.Rd b/man/pub_nidss_flu.Rd index 134d86aa..a202a086 100644 --- a/man/pub_nidss_flu.Rd +++ b/man/pub_nidss_flu.Rd @@ -16,7 +16,8 @@ pub_nidss_flu( \arguments{ \item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} diff --git a/man/pub_nowcast.Rd b/man/pub_nowcast.Rd index 398877cc..8c5157be 100644 --- a/man/pub_nowcast.Rd +++ b/man/pub_nowcast.Rd @@ -9,7 +9,8 @@ pub_nowcast(locations, epiweeks = "*", fetch_args = fetch_args_list()) \arguments{ \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pub_paho_dengue.Rd b/man/pub_paho_dengue.Rd index 23c35ace..2566beb0 100644 --- a/man/pub_paho_dengue.Rd +++ b/man/pub_paho_dengue.Rd @@ -16,7 +16,8 @@ pub_paho_dengue( \arguments{ \item{regions}{character. Vector of regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{...}{not used for values, forces later arguments to bind by name} diff --git a/man/pvt_cdc.Rd b/man/pvt_cdc.Rd index 7e546732..9e87963b 100644 --- a/man/pvt_cdc.Rd +++ b/man/pvt_cdc.Rd @@ -11,7 +11,8 @@ pvt_cdc(auth, locations, epiweeks = "*", fetch_args = fetch_args_list()) \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pvt_dengue_sensors.Rd b/man/pvt_dengue_sensors.Rd index 3cc9a7b6..8d38e4f9 100644 --- a/man/pvt_dengue_sensors.Rd +++ b/man/pvt_dengue_sensors.Rd @@ -20,7 +20,8 @@ pvt_dengue_sensors( \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pvt_ght.Rd b/man/pvt_ght.Rd index 3758eda6..e6bbccf4 100644 --- a/man/pvt_ght.Rd +++ b/man/pvt_ght.Rd @@ -11,7 +11,8 @@ pvt_ght(auth, locations, epiweeks = "*", query, fetch_args = fetch_args_list()) \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{query}{string. The query to be fetched.} diff --git a/man/pvt_norostat.Rd b/man/pvt_norostat.Rd index d2b8787d..449ae217 100644 --- a/man/pvt_norostat.Rd +++ b/man/pvt_norostat.Rd @@ -13,7 +13,8 @@ pvt_norostat(auth, locations, epiweeks = "*", fetch_args = fetch_args_list()) full state names are permitted. See the \code{locations} column in the output of \code{pvt_meta_norostat()} for the allowed values.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pvt_quidel.Rd b/man/pvt_quidel.Rd index 5e8041c5..5b4f2cc0 100644 --- a/man/pvt_quidel.Rd +++ b/man/pvt_quidel.Rd @@ -11,7 +11,8 @@ pvt_quidel(auth, locations, epiweeks = "*", fetch_args = fetch_args_list()) \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} diff --git a/man/pvt_sensors.Rd b/man/pvt_sensors.Rd index e8478901..5e57a4c2 100644 --- a/man/pvt_sensors.Rd +++ b/man/pvt_sensors.Rd @@ -20,7 +20,8 @@ pvt_sensors( \item{locations}{character. Vector of locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports +\code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} \item{fetch_args}{\code{\link{fetch_args}}. Additional arguments to pass to \code{fetch()}. See \code{fetch_args_list()} for details.} From b5acce77583c67fffcef9b002a1485361fb5a269 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Fri, 7 Nov 2025 11:42:15 -0800 Subject: [PATCH 12/16] docs: correcting regions' description for pub_fluview functions --- R/endpoints.R | 11 +++++++---- man/pub_fluview.Rd | 7 ++++++- man/pub_fluview_clinical.Rd | 9 ++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/R/endpoints.R b/R/endpoints.R index 1285231d..7d1db505 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -1368,9 +1368,12 @@ pub_flusurv <- function( #' pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) #' #' @inheritParams .epidatr_shared_params -#' @param regions character. Locations to fetch. Can be any string IDs in -#' national, HHS region, census division, most states and territories, and so -#' on. Full list link below. +#' @param regions character. Vector of location IDs to fetch. Can be +#' "nat" for national, "hhs1"--"hhs10" for HHS Regions, "cen1"--"cen9" for +#' census divisions, lowercase two-letter state or territory abbreviations +#' for most states and territories,"jfk" for New York City, or "ny_minus_jfk" +#' for upstate New York. Full list of locations is available +#' [here](https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt). #' @return [`tibble::tibble`] #' #' @inheritSection .epidatr_shared_params Data Versioning @@ -1468,8 +1471,8 @@ pub_fluview_meta <- function(fetch_args = fetch_args_list()) { #' #' pub_fluview(regions = "nat", epiweeks = epirange(201201, 202005)) #' -#' @inheritParams .epidatr_shared_params #' @inheritParams pub_fluview_clinical +#' @inheritParams .epidatr_shared_params #' @return [`tibble::tibble`] #' #' @inheritSection .epidatr_shared_params Data Versioning diff --git a/man/pub_fluview.Rd b/man/pub_fluview.Rd index 433fbefc..6c6227de 100644 --- a/man/pub_fluview.Rd +++ b/man/pub_fluview.Rd @@ -15,7 +15,12 @@ pub_fluview( ) } \arguments{ -\item{regions}{character. Vector of regions to fetch.} +\item{regions}{character. Vector of location IDs to fetch. Can be +"nat" for national, "hhs1"--"hhs10" for HHS Regions, "cen1"--"cen9" for +census divisions, lowercase two-letter state or territory abbreviations +for most states and territories,"jfk" for New York City, or "ny_minus_jfk" +for upstate New York. Full list of locations is available +\href{https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt}{here}.} \item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports \code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} diff --git a/man/pub_fluview_clinical.Rd b/man/pub_fluview_clinical.Rd index 5867a877..140dcb88 100644 --- a/man/pub_fluview_clinical.Rd +++ b/man/pub_fluview_clinical.Rd @@ -14,9 +14,12 @@ pub_fluview_clinical( ) } \arguments{ -\item{regions}{character. Locations to fetch. Can be any string IDs in -national, HHS region, census division, most states and territories, and so -on. Full list link below.} +\item{regions}{character. Vector of location IDs to fetch. Can be +"nat" for national, "hhs1"--"hhs10" for HHS Regions, "cen1"--"cen9" for +census divisions, lowercase two-letter state or territory abbreviations +for most states and territories,"jfk" for New York City, or "ny_minus_jfk" +for upstate New York. Full list of locations is available +\href{https://github.com/cmu-delphi/delphi-epidata/blob/main/labels/regions.txt}{here}.} \item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Supports \code{\link[=epirange]{epirange()}} and defaults to all ("*") dates.} From 19bc5fa02cd1fe58546fa0080aa7d59df75c7bff Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Fri, 7 Nov 2025 19:44:23 +0000 Subject: [PATCH 13/16] docs: document (GHA) --- man/covidcast_epidata.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index 158d8008..e3a997a8 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 526 x 3 +#> # A tibble: 508 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 516 more rows +#> # i 498 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type From 8e0bf25d8adec0a84d88bba52b5d8cc600f6eaa3 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Fri, 7 Nov 2025 19:45:44 +0000 Subject: [PATCH 14/16] style: styler (GHA) --- R/endpoints.R | 4 +--- R/request.R | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/R/endpoints.R b/R/endpoints.R index 7d1db505..de19e269 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -590,7 +590,6 @@ pub_covid_hosp_facility <- function( #' dates = epirange(20200101, 20200501) #' ) #' -#' #' @inheritParams .epidatr_shared_params #' #' @inheritSection .epidatr_shared_params Data Versioning @@ -1365,7 +1364,7 @@ pub_flusurv <- function( #' #' @examplesIf curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "" #' -#' pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) +#' pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) #' #' @inheritParams .epidatr_shared_params #' @param regions character. Vector of location IDs to fetch. Can be @@ -1434,7 +1433,6 @@ pub_fluview_clinical <- function( #' #' pub_fluview_meta() #' -#' #' @inheritParams .epidatr_shared_params #' #' @return [`tibble::tibble`] diff --git a/R/request.R b/R/request.R index 56a83d88..cf8ef4ed 100644 --- a/R/request.R +++ b/R/request.R @@ -19,7 +19,6 @@ join_url <- function(url, endpoint) { #' base64enc::base64encode(charToRaw("epidata:fake_key")) #' ) #' -#' #' @importFrom httr RETRY #' @keywords internal do_request <- function(url, params, timeout_seconds) { From a5f5c92230f34dcc224350c2d62813f3ec2acf0e Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Mon, 10 Nov 2025 20:18:40 -0800 Subject: [PATCH 15/16] =?UTF-8?q?docs:=20include=20examples=20using=20the?= =?UTF-8?q?=20`issues`=20and=20`lag`=20arguments=20in=20the=20=E2=80=9CGet?= =?UTF-8?q?ting=20Started=E2=80=9D=20vignette=20and=20add=20references=20t?= =?UTF-8?q?o=20the=20versioned=20data=20vignette=20in=20the=20versioned=20?= =?UTF-8?q?data=20documentation=20section.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/endpoints.R | 2 ++ man/covidcast_epidata.Rd | 4 +-- man/do_request.Rd | 1 - man/dot-epidatr_shared_params.Rd | 2 ++ man/pub_covid_hosp_state_timeseries.Rd | 3 ++- man/pub_covidcast.Rd | 2 ++ man/pub_ecdc_ili.Rd | 2 ++ man/pub_flusurv.Rd | 2 ++ man/pub_fluview.Rd | 2 ++ man/pub_fluview_clinical.Rd | 4 ++- man/pub_fluview_meta.Rd | 1 - man/pub_kcdc_ili.Rd | 2 ++ man/pub_nidss_flu.Rd | 2 ++ man/pub_paho_dengue.Rd | 2 ++ vignettes/epidatr.Rmd | 36 ++++++++++++++++++++++++-- 15 files changed, 59 insertions(+), 8 deletions(-) diff --git a/R/endpoints.R b/R/endpoints.R index de19e269..3244e422 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -40,6 +40,8 @@ #' \item \code{lag}: (integer) Retrieve data with a specific lag from #' its issue date. #' } +#' See `vignette("versioned-data")` for details and more ways to specify +#' versioned data. NULL diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index e3a997a8..158d8008 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 508 x 3 +#> # A tibble: 526 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 498 more rows +#> # i 516 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type diff --git a/man/do_request.Rd b/man/do_request.Rd index ae01057b..d81558f2 100644 --- a/man/do_request.Rd +++ b/man/do_request.Rd @@ -20,7 +20,6 @@ content(response)$headers$Authorization == paste0( "Basic ", base64enc::base64encode(charToRaw("epidata:fake_key")) ) - \dontshow{\}) # examplesIf} } \keyword{internal} diff --git a/man/dot-epidatr_shared_params.Rd b/man/dot-epidatr_shared_params.Rd index 3f48d5da..d0643441 100644 --- a/man/dot-epidatr_shared_params.Rd +++ b/man/dot-epidatr_shared_params.Rd @@ -56,6 +56,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \keyword{internal} diff --git a/man/pub_covid_hosp_state_timeseries.Rd b/man/pub_covid_hosp_state_timeseries.Rd index 0fefc532..7fae0f12 100644 --- a/man/pub_covid_hosp_state_timeseries.Rd +++ b/man/pub_covid_hosp_state_timeseries.Rd @@ -56,6 +56,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ @@ -65,7 +67,6 @@ pub_covid_hosp_state_timeseries( states = "fl", dates = epirange(20200101, 20200501) ) - \dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_covidcast.Rd b/man/pub_covidcast.Rd index 82328f0a..b22219e0 100644 --- a/man/pub_covidcast.Rd +++ b/man/pub_covidcast.Rd @@ -74,6 +74,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ diff --git a/man/pub_ecdc_ili.Rd b/man/pub_ecdc_ili.Rd index e2d5b883..d5681069 100644 --- a/man/pub_ecdc_ili.Rd +++ b/man/pub_ecdc_ili.Rd @@ -55,6 +55,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ diff --git a/man/pub_flusurv.Rd b/man/pub_flusurv.Rd index ce573c23..319fb4f6 100644 --- a/man/pub_flusurv.Rd +++ b/man/pub_flusurv.Rd @@ -57,6 +57,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ diff --git a/man/pub_fluview.Rd b/man/pub_fluview.Rd index 6c6227de..952bc541 100644 --- a/man/pub_fluview.Rd +++ b/man/pub_fluview.Rd @@ -66,6 +66,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ diff --git a/man/pub_fluview_clinical.Rd b/man/pub_fluview_clinical.Rd index 140dcb88..b38c7b8b 100644 --- a/man/pub_fluview_clinical.Rd +++ b/man/pub_fluview_clinical.Rd @@ -53,12 +53,14 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ \dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} - pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) +pub_fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) \dontshow{\}) # examplesIf} } \keyword{endpoint} diff --git a/man/pub_fluview_meta.Rd b/man/pub_fluview_meta.Rd index 65f600dc..7e3be565 100644 --- a/man/pub_fluview_meta.Rd +++ b/man/pub_fluview_meta.Rd @@ -20,7 +20,6 @@ API docs: \url{https://cmu-delphi.github.io/delphi-epidata/api/fluview_meta.html \dontshow{if (curl::has_internet() && Sys.getenv("DELPHI_EPIDATA_KEY") != "") withAutoprint(\{ # examplesIf} pub_fluview_meta() - \dontshow{\}) # examplesIf} } \seealso{ diff --git a/man/pub_kcdc_ili.Rd b/man/pub_kcdc_ili.Rd index 17e58186..f3dbec69 100644 --- a/man/pub_kcdc_ili.Rd +++ b/man/pub_kcdc_ili.Rd @@ -48,6 +48,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ diff --git a/man/pub_nidss_flu.Rd b/man/pub_nidss_flu.Rd index a202a086..05b8fc91 100644 --- a/man/pub_nidss_flu.Rd +++ b/man/pub_nidss_flu.Rd @@ -51,6 +51,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ diff --git a/man/pub_paho_dengue.Rd b/man/pub_paho_dengue.Rd index 2566beb0..0c4fb5c7 100644 --- a/man/pub_paho_dengue.Rd +++ b/man/pub_paho_dengue.Rd @@ -48,6 +48,8 @@ specific issue date or range. \item \code{lag}: (integer) Retrieve data with a specific lag from its issue date. } +See \code{vignette("versioned-data")} for details and more ways to specify +versioned data. } \examples{ diff --git a/vignettes/epidatr.Rmd b/vignettes/epidatr.Rmd index 40780163..c18e4df9 100644 --- a/vignettes/epidatr.Rmd +++ b/vignettes/epidatr.Rmd @@ -138,8 +138,8 @@ pub_covidcast( The Epidata API stores a historical record of all data, including corrections and updates, which is particularly useful for accurately backtesting -forecasting models. To fetch versioned data, we can use the `as_of` -argument. +forecasting models. To retrieve versioned data, we can use the `as_of` +argument, which fetch the data as it was known on a specific date. ```{r, eval = FALSE} # Obtain the smoothed covid-like illness (CLI) signal from the COVID-19 @@ -155,6 +155,38 @@ pub_covidcast( ) ``` +We can also request all versions of the data issued within a specific time period using the `issues` argument. + +```{r, eval = FALSE} +# See how the estimate for a SINGLE day (March 1, 2021) evolved +# by fetching all issues reported between March and April 2021. +pub_covidcast( + source = "fb-survey", + signals = "smoothed_cli", + geo_type = "state", + time_type = "day", + geo_values = "pa", + time_values = "2021-03-01", + issues = epirange("2021-03-01", "2021-04-30") +) +``` + +Finally, we can use the `lag` argument to request only data that was reported a certain number of days after the event. + +```{r, eval = FALSE} +# Fetch survey data for January 2021, but ONLY include data +# that was issued exactly 2 days after it was collected. +pub_covidcast( + source = "fb-survey", + signals = "smoothed_cli", + geo_type = "state", + time_type = "day", + geo_values = "pa", + time_values = epirange(20210101, 20210131), + lag = 2 +) +``` + See `vignette("versioned-data")` for details and more ways to specify versioned data. From fa891bcbf11780648096e63a37e1ef90feb47443 Mon Sep 17 00:00:00 2001 From: JavierMtzRdz Date: Tue, 11 Nov 2025 04:20:55 +0000 Subject: [PATCH 16/16] docs: document (GHA) --- man/covidcast_epidata.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index 158d8008..e3a997a8 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -27,7 +27,7 @@ an object containing fields for every signal: \if{html}{\out{
}}\preformatted{epidata <- covidcast_epidata() epidata$signals -#> # A tibble: 526 x 3 +#> # A tibble: 508 x 3 #> source signal short_description #> #> 1 chng smoothed_outpatient_cli Estimated percentage of outpatie~ @@ -40,7 +40,7 @@ epidata$signals #> 8 chng 7dav_outpatient_covid Ratio of outpatient doctor visit~ #> 9 covid-act-now pcr_specimen_positivity_rate Proportion of PCR specimens test~ #> 10 covid-act-now pcr_specimen_total_tests Total number of PCR specimens te~ -#> # i 516 more rows +#> # i 498 more rows }\if{html}{\out{
}} If you use an editor that supports tab completion, such as RStudio, type