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' diff --git a/R/endpoints.R b/R/endpoints.R index 1f789d18..e82a9928 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -22,10 +22,11 @@ #' @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) @@ -88,13 +89,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) @@ -182,11 +184,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") @@ -567,12 +570,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() @@ -982,17 +986,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 @@ -1097,9 +1102,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) @@ -1134,9 +1140,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) @@ -1177,11 +1184,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) @@ -1234,12 +1242,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") @@ -1301,12 +1310,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") @@ -1340,7 +1350,30 @@ pub_flusurv <- function( create_epidata_field_info("rate_age_2", "float"), create_epidata_field_info("rate_age_3", "float"), create_epidata_field_info("rate_age_4", "float"), - create_epidata_field_info("rate_overall", "float") + create_epidata_field_info("rate_overall", "float"), + create_epidata_field_info("rate_age_5", "float"), + create_epidata_field_info("rate_age_6", "float"), + create_epidata_field_info("rate_age_7", "float"), + create_epidata_field_info("rate_age_18t29", "float"), + create_epidata_field_info("rate_age_30t39", "float"), + create_epidata_field_info("rate_age_40t49", "float"), + create_epidata_field_info("rate_age_5t11", "float"), + create_epidata_field_info("rate_age_12t17", "float"), + create_epidata_field_info("rate_age_lt18", "float"), + create_epidata_field_info("rate_age_gte18", "float"), + create_epidata_field_info("rate_age_0tlt1", "float"), + create_epidata_field_info("rate_age_1t4", "float"), + create_epidata_field_info("rate_age_gte75", "float"), + create_epidata_field_info("rate_race_white", "float"), + create_epidata_field_info("rate_race_black", "float"), + create_epidata_field_info("rate_race_hisp", "float"), + create_epidata_field_info("rate_race_asian", "float"), + create_epidata_field_info("rate_race_natamer", "float"), + create_epidata_field_info("rate_sex_male", "float"), + create_epidata_field_info("rate_sex_female", "float"), + create_epidata_field_info("rate_flu_a", "float"), + create_epidata_field_info("rate_flu_b", "float"), + create_epidata_field_info("season", "text") ) ) %>% fetch(fetch_args = fetch_args) } @@ -1367,12 +1400,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") @@ -1474,13 +1508,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") @@ -1554,9 +1589,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) @@ -1599,11 +1635,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) @@ -1648,12 +1685,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") @@ -1749,9 +1787,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) @@ -1793,12 +1832,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") @@ -1860,10 +1900,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) @@ -1906,9 +1947,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) @@ -1947,12 +1989,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") @@ -2010,10 +2053,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) @@ -2069,11 +2113,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) @@ -2128,12 +2173,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) @@ -2212,13 +2258,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) 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{