diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d826d2fc..ee79dd70 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.1 +current_version = 0.8.0 commit = False tag = False diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3776adff..be44f0a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,5 +36,4 @@ jobs: DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPROCESS_GHACTIONS_DELPHI_EPIDATA_KEY }} with: args: 'c("--no-manual", "--as-cran")' - build-args: 'c("--no-build-vignettes")' error-on: '"error"' diff --git a/DESCRIPTION b/DESCRIPTION index f5eec053..db218ca5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: epidatr Type: Package Title: Client for Delphi's Epidata API -Version: 0.7.1 +Version: 0.8.0 Authors@R: c( person("Logan", "Brooks", email = "lcbrooks@andrew.cmu.edu", role = c("aut", "cre")), diff --git a/NAMESPACE b/NAMESPACE index 4fcb22bb..d8e4ef3e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,14 +4,12 @@ S3method(as.data.frame,covidcast_data_signal_list) S3method(as.data.frame,covidcast_data_source_list) S3method(print,covidcast_data_signal) S3method(print,covidcast_data_source) -S3method(print,covidcast_epidata) S3method(print,epidata_call) export("%>%") export(covid_hosp_facility) export(covid_hosp_facility_lookup) export(covid_hosp_state_timeseries) export(covidcast) -export(covidcast_epidata) export(covidcast_meta) export(delphi) export(dengue_nowcast) diff --git a/NEWS.md b/NEWS.md index dc38667c..25084ff8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# epidatr 0.8.0 + +- Fix source name duplication bug in `covidcast_epidata` +- Mark `covidcast_epidata` as experimental and do not export it + # epidatr 0.7.1 - Update README.md for better onboarding. @@ -20,4 +25,4 @@ will output a nested list structure. - The package that this installs is being renamed from `delphi.epidata` to `epidatr`. To migrate, run the installation command above, followed by `remove.packages("delphi.epidata")`, and adjust all references to the package -name accordingly. \ No newline at end of file +name accordingly. diff --git a/R/constants.R b/R/constants.R index a3777e00..cf926be2 100644 --- a/R/constants.R +++ b/R/constants.R @@ -1,3 +1,3 @@ -version <- "0.7.1" +version <- "0.8.0" http_headers <- httr::add_headers("User-Agent" = paste0("epidatr/", version), "Accept-Encoding" = "gzip") global_base_url <- "https://api.delphi.cmu.edu/epidata/" diff --git a/R/covidcast.R b/R/covidcast.R index 37014435..a818018b 100644 --- a/R/covidcast.R +++ b/R/covidcast.R @@ -91,14 +91,6 @@ print.covidcast_data_source <- function(source, ...) { #' Creates a helper object that can use auto-complete to help find covidcast #' sources and signals. #' -#' @examples -#' covidcast_api <- covidcast_epidata() -#' print(covidcast_api) # print available sources and signals -#' fb_survey <- covidcast_api$sources$`fb-survey` # tab completion for sources -#' print(fb_survey) # print a verbose list of available signals -#' smoothed_cli <- fb_survey$signals$smoothed_cli # tab completion for signals -#' print(smoothed_cli) -#' df <- smoothed_cli$call("nation", "us", epirange(20210405, 20210410)) #' @param base_url optional alternative API base url #' @param timeout_seconds the maximum amount of time to wait for a response #' @importFrom httr stop_for_status content http_type @@ -106,7 +98,6 @@ print.covidcast_data_source <- function(source, ...) { #' @importFrom xml2 read_html xml_find_all xml_text #' @return an instance of covidcast_epidata #' -#' @export covidcast_epidata <- function(base_url = global_base_url, timeout_seconds = 30) { url <- join_url(base_url, "covidcast/meta") response <- do_request(url, list(), timeout_seconds) @@ -130,11 +121,13 @@ covidcast_epidata <- function(base_url = global_base_url, timeout_seconds = 30) sources <- do.call(c, lapply(response_content, parse_source, base_url = base_url)) class(sources) <- c("covidcast_data_source_list", class(sources)) - all_signals <- do.call(c, lapply(sources, function(x) { - l <- c(x$signals) - names(l) <- paste(x$source, names(l), sep = ":") - l - })) + all_signals <- do.call(c, unname( + lapply(sources, function(x) { + l <- c(x$signals) + names(l) <- paste(x$source, names(l), sep = ":") + l + }) + )) class(all_signals) <- c("covidcast_data_signal_list", class(all_signals)) structure( list( @@ -161,7 +154,6 @@ as.data.frame.covidcast_data_source_list <- function(sources, ...) { }), ...) } -#' @export print.covidcast_epidata <- function(epidata, ...) { print("COVIDcast Epidata Fetcher") print("Sources:") diff --git a/R/endpoints.R b/R/endpoints.R index df9395e7..3861c0a4 100644 --- a/R/endpoints.R +++ b/R/endpoints.R @@ -11,8 +11,8 @@ #' ) %>% fetch() #' } #' @param auth string. Restricted access key (not the same as API key). +#' @param locations character. Locations to fetch. #' @param epiweeks [`timeset`]. Epiweeks to fetch. -#' @param locations character vector. Locations to fetch (see docs). #' @return [`epidata_call`] #' #' @export @@ -64,9 +64,9 @@ pvt_cdc <- function(auth, locations, epiweeks) { #' covid_hosp_facility_lookup(state = "fl") %>% fetch() #' covid_hosp_facility_lookup(city = "southlake") %>% fetch() #' } -#' @param state string. A two-letter character string state abbreviation. -#' @param ccn string. A character string for facility CMS certification number. -#' @param city string. A characater string for city name. +#' @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. #' @return [`epidata_call`] @@ -91,6 +91,10 @@ covid_hosp_facility_lookup <- function(state = NULL, ccn = NULL, city = NULL, zi stop("one of `state`, `ccn`, `city`, `zip`, or `fips_code` is required") } + if (sum(!missing(state), !missing(ccn), !missing(city), !missing(zip), !missing(fips_code)) > 1) { + stop("only one of `state`, `ccn`, `city`, `zip`, or `fips_code` can be specified") + } + create_epidata_call( "covid_hosp_facility_lookup/", list( @@ -135,8 +139,7 @@ covid_hosp_facility_lookup <- function(state = NULL, ccn = NULL, city = NULL, zi #' collection_weeks = epirange(20200101, 20200501) #' ) %>% fetch() #' } -#' @param hospital_pks string. A character string of facility unique -#' identifiers. +#' @param hospital_pks character. Facility identifiers. #' @param collection_weeks [`timeset`]. Epiweeks to fetch. #' @param publication_dates [`timeset`]. Publication dates to fetch. #' @return [`epidata_call`] @@ -428,7 +431,7 @@ covid_hosp_facility <- function(hospital_pks, collection_weeks, publication_date #' dates = epirange(20200101, 20200501) #' ) %>% fetch() #' } -#' @param states character vector. Two letter state abbreviations. +#' @param states character. Two letter state abbreviations. #' @param dates [`timeset`]. Dates to fetch. #' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the #' most recent issue is returned. @@ -621,7 +624,7 @@ covidcast_meta <- function() { #' @examples #' \dontrun{ #' covidcast( -#' data_source = "jhu-csse", +#' source = "jhu-csse", #' signals = "confirmed_7dav_incidence_prop", #' geo_type = "state", #' time_type = "day", @@ -629,7 +632,7 @@ covidcast_meta <- function() { #' time_values = epirange(20200601, 20200801) #' ) %>% fetch() #' covidcast( -#' data_source = "jhu-csse", +#' source = "jhu-csse", #' signals = "confirmed_7dav_incidence_prop", #' geo_type = "state", #' time_type = "day", @@ -645,10 +648,10 @@ covidcast_meta <- function() { #' ). #' @param time_type string. The temporal resolution of the data (either "day" or #' "week", depending on signal). -#' @param geo_values character vector. The geographies to return. "*" fetches +#' @param geo_values character. The geographies to return. "*" fetches #' all. (See: #' .) -#' @param time_values [`timeset`]. The dates to fetch. +#' @param time_values [`timeset`]. Dates to fetch. #' @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`. @@ -664,7 +667,7 @@ covidcast_meta <- function() { #' #' @export covidcast <- function( - data_source, + source, signals, geo_type, time_type, @@ -675,7 +678,7 @@ covidcast <- function( lag = NULL) { # Check parameters if ( - missing(data_source) || + missing(source) || missing(signals) || missing(time_type) || missing(geo_type) || @@ -686,10 +689,11 @@ covidcast <- function( ) } - if (!missing(issues) && !missing(lag)) { - stop("`issues` and `lag` are mutually exclusive") + if (sum(!missing(issues), !missing(lag), !missing(as_of)) > 1) { + stop("`issues`, `lag`, and `as_of` are mutually exclusive") } - assert_character_param("data_source", data_source, len = 1) + + assert_character_param("data_source", source, len = 1) assert_character_param("signals", signals) assert_character_param("time_type", time_type, len = 1) assert_character_param("geo_type", geo_type, len = 1) @@ -705,7 +709,7 @@ covidcast <- function( create_epidata_call( "covidcast/", list( - data_source = data_source, + data_source = source, signals = signals, geo_type = geo_type, time_type = time_type, @@ -750,8 +754,8 @@ covidcast <- function( #' \dontrun{ #' delphi(system = "ec", epiweek = 201501) %>% fetch() #' } -#' @param system string. The system name to fetch. -#' @param epiweek [`timeset`]. The epiweeks to fetch. +#' @param system character. System name to fetch. +#' @param epiweek [`timeset`]. Epiweeks to fetch. #' @return [`epidata_call`] #' #' @export @@ -784,8 +788,8 @@ delphi <- function(system, epiweek) { #' epiweeks = epirange(201501, 202001) #' ) %>% fetch() #' } -#' @param locations character vector. The locations to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @return [`epidata_call`] #' #' @export @@ -822,9 +826,9 @@ dengue_nowcast <- function(locations, epiweeks) { #' ) %>% fetch() #' } #' @param auth string. Restricted access key (not the same as API key). -#' @param names character vector. The list of names to fetch. -#' @param locations character vector. The locations to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param names character. Names to fetch. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @return [`epidata_call`] #' #' @export @@ -866,8 +870,8 @@ pvt_dengue_sensors <- function(auth, names, locations, epiweeks) { #' \dontrun{ #' ecdc_ili(regions = "austria", epiweeks = epirange(201901, 202001)) %>% fetch() #' } -#' @param regions character vector. The regions to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param regions character. Regions to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @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, @@ -920,8 +924,8 @@ ecdc_ili <- function(regions, epiweeks, issues = NULL, lag = NULL) { #' \dontrun{ #' flusurv(locations = "CA", epiweeks = epirange(201701, 201801)) %>% fetch() #' } -#' @param locations character vector. Character strings indicating location. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param locations character. Character vector indicating location. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @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, @@ -972,8 +976,8 @@ flusurv <- function(locations, epiweeks, issues = NULL, lag = NULL) { #' \dontrun{ #' fluview_clinical(regions = "nat", epiweeks = epirange(201601, 201701)) %>% fetch() #' } -#' @param regions character vector. The regions to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch in the form +#' @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). #' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the @@ -1056,10 +1060,10 @@ fluview_meta <- function() { #' #' @examples #' fluview(regions = "nat", epiweeks = epirange(201201, 202001)) %>% fetch() -#' @param regions character vector. The locations to fetch. Can we any string -#' IDs in national, HHS region, census division, most states and territories, -#' and so on. Full list link below. -#' @param epiweeks [`timeset`]. The epiweeks to fetch in the form +#' @param regions character. Locations to fetch. Can we 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). #' @param issues [`timeset`]. Optionally, the issues to fetch. If not set, the @@ -1131,8 +1135,8 @@ fluview <- function(regions, epiweeks, issues = NULL, lag = NULL, auth = NULL) { #' \dontrun{ #' gft(locations = "hhs1", epiweeks = epirange(201201, 202001)) %>% fetch() #' } -#' @param locations character vector. The locations to be fetched. -#' @param epiweeks [`timeset`] The epiweeks to be fetched. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`] Epiweeks to fetch. #' #' @return [`epidata_call`] #' @@ -1168,8 +1172,8 @@ gft <- function(locations, epiweeks) { #' ) %>% fetch() #' } #' @param auth string. Restricted access key (not the same as API key). -#' @param locations character vector. The locations to be fetched. -#' @param epiweeks [`timeset`]. The epiweeks to be fetched. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @param query string. The query to be fetched. #' @return [`epidata_call`] #' @@ -1206,8 +1210,8 @@ pvt_ght <- function(auth, locations, epiweeks, query) { #' \dontrun{ #' kcdc_ili(regions = "ROK", epiweeks = 200436) %>% fetch() #' } -#' @param regions character vector. The regions to be fetched. -#' @param epiweeks [`timeset`]. The epiweeks to be fetched. +#' @param regions character. Regions to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @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, @@ -1290,8 +1294,8 @@ meta <- function() { #' \dontrun{ #' nidss_dengue(locations = "taipei", epiweeks = epirange(201201, 201301)) %>% fetch() #' } -#' @param locations character vector. The locations to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetched. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' #' @return [`epidata_call`] #' @@ -1323,8 +1327,8 @@ nidss_dengue <- function(locations, epiweeks) { #' \dontrun{ #' nidss_flu(regions = "taipei", epiweeks = epirange(201501, 201601)) %>% fetch() #' } -#' @param regions character vector. The regions to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param regions character. Regions to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @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, @@ -1378,8 +1382,8 @@ nidss_flu <- function(regions, epiweeks, issues = NULL, lag = NULL) { #' ) %>% fetch() #' } #' @param auth string. Your authentication key. -#' @param locations character vector. The locations to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @return [`epidata_call`] #' #' @export @@ -1418,8 +1422,8 @@ pvt_norostat <- function(auth, locations, epiweeks) { #' \dontrun{ #' nowcast(locations = "ca", epiweeks = epirange(201201, 201301)) %>% fetch() #' } -#' @param locations character vector. The locations to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @return [`epidata_call`] #' #' @export @@ -1448,8 +1452,8 @@ nowcast <- function(locations, epiweeks) { #' \dontrun{ #' paho_dengue(regions = "ca", epiweeks = epirange(201401, 201501)) %>% fetch() #' } -#' @param regions character vector. The regions to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param regions character. Regions to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @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, @@ -1502,8 +1506,8 @@ paho_dengue <- function(regions, epiweeks, issues = NULL, lag = NULL) { #' ) %>% fetch() #' } #' @param auth string. Restricted access key (not the same as API key). -#' @param locations character vector. The locations to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @return [`epidata_call`] #' #' @export @@ -1542,9 +1546,9 @@ pvt_quidel <- function(auth, locations, epiweeks) { #' ) %>% fetch() #' } #' @param auth string. Restricted access key (not the same as API key). -#' @param names character vector. The names of the sensors to fetch. -#' @param locations character vector. The locations to fetch. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. +#' @param names character. Sensor names to fetch. +#' @param locations character. Locations to fetch. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. #' @return [`epidata_call`] #' #' @export @@ -1581,10 +1585,9 @@ pvt_sensors <- function(auth, names, locations, epiweeks) { #' pvt_twitter(auth = "yourkey", locations = "CA", epiweeks = epirange(201501, 202001)) %>% fetch() #' } #' @param auth string. Restricted access key (not the same as API key). -#' @param locations character vector. The locations to fetch. -#' @param dates [`timeset`]. The dates to fetch. Mutually exclusive with -#' `epiweeks`. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. Mutually exclusive with +#' @param locations character. Locations to fetch. +#' @param dates [`timeset`]. Dates to fetch. Mutually exclusive with `epiweeks`. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. Mutually exclusive with #' `dates`. #' @return [`epidata_call`] #' @@ -1631,12 +1634,11 @@ pvt_twitter <- function(auth, locations, dates = NULL, epiweeks = NULL) { #' \dontrun{ #' wiki(articles = "avian_influenza", epiweeks = epirange(201501, 201601)) %>% fetch() #' } -#' @param articles character vector. The articles to fetch. -#' @param dates [`timeset`]. The dates to fetch. Mutually exclusive with -#' `epiweeks`. -#' @param epiweeks [`timeset`]. The epiweeks to fetch. Mutually exclusive with +#' @param articles character. Articles to fetch. +#' @param dates [`timeset`]. Dates to fetch. Mutually exclusive with `epiweeks`. +#' @param epiweeks [`timeset`]. Epiweeks to fetch. Mutually exclusive with #' `dates`. -#' @param language string. The language to fetch. +#' @param language string. Language to fetch. #' @param hours integer. Optionally, the hours to fetch. #' @return [`epidata_call`] #' diff --git a/R/epidatacall.R b/R/epidatacall.R index e069231d..6017037d 100644 --- a/R/epidatacall.R +++ b/R/epidatacall.R @@ -20,7 +20,7 @@ #' #' @examples #' covidcast( -#' data_source = "jhu-csse", +#' source = "jhu-csse", #' signals = "confirmed_7dav_incidence_prop", #' time_type = "day", #' geo_type = "state", diff --git a/man/covid_hosp_facility.Rd b/man/covid_hosp_facility.Rd index 8db61192..15d8c926 100644 --- a/man/covid_hosp_facility.Rd +++ b/man/covid_hosp_facility.Rd @@ -7,8 +7,7 @@ covid_hosp_facility(hospital_pks, collection_weeks, publication_dates = NULL) } \arguments{ -\item{hospital_pks}{string. A character string of facility unique -identifiers.} +\item{hospital_pks}{character. Facility identifiers.} \item{collection_weeks}{\code{\link{timeset}}. Epiweeks to fetch.} diff --git a/man/covid_hosp_facility_lookup.Rd b/man/covid_hosp_facility_lookup.Rd index 329af681..c945946b 100644 --- a/man/covid_hosp_facility_lookup.Rd +++ b/man/covid_hosp_facility_lookup.Rd @@ -13,11 +13,11 @@ covid_hosp_facility_lookup( ) } \arguments{ -\item{state}{string. A two-letter character string state abbreviation.} +\item{state}{string. A two-letter character state abbreviation.} -\item{ccn}{string. A character string for facility CMS certification number.} +\item{ccn}{string. A facility CMS certification number.} -\item{city}{string. A characater string for city name.} +\item{city}{string. A city name.} \item{zip}{string. A 5-digit zip code.} diff --git a/man/covid_hosp_state_timeseries.Rd b/man/covid_hosp_state_timeseries.Rd index 760b01b8..6475fbc3 100644 --- a/man/covid_hosp_state_timeseries.Rd +++ b/man/covid_hosp_state_timeseries.Rd @@ -7,7 +7,7 @@ covid_hosp_state_timeseries(states, dates, issues = NULL) } \arguments{ -\item{states}{character vector. Two letter state abbreviations.} +\item{states}{character. Two letter state abbreviations.} \item{dates}{\code{\link{timeset}}. Dates to fetch.} diff --git a/man/covidcast.Rd b/man/covidcast.Rd index 0c6c0013..8ecc5c0d 100644 --- a/man/covidcast.Rd +++ b/man/covidcast.Rd @@ -5,7 +5,7 @@ \title{Fetch covidcast data} \usage{ covidcast( - data_source, + source, signals, geo_type, time_type, @@ -17,9 +17,6 @@ covidcast( ) } \arguments{ -\item{data_source}{string. The data source to query (see: -\url{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_signals.html}).} - \item{signals}{string. The signals to query from a specific source (see: \url{https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals.html}).} @@ -29,11 +26,11 @@ covidcast( \item{time_type}{string. The temporal resolution of the data (either "day" or "week", depending on signal).} -\item{geo_values}{character vector. The geographies to return. "*" fetches +\item{geo_values}{character. The geographies to return. "*" fetches all. (See: \url{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html}.)} -\item{time_values}{\code{\link{timeset}}. The dates to fetch.} +\item{time_values}{\code{\link{timeset}}. Dates to fetch.} \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 @@ -46,6 +43,9 @@ specified, the most recent issue is returned. Mutually exclusive with \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{data_source}{string. The data source to query (see: +\url{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_signals.html}).} } \value{ \code{\link{epidata_call}} @@ -59,7 +59,7 @@ COVIDcast public dashboard: \url{https://delphi.cmu.edu/covidcast/} \examples{ \dontrun{ covidcast( - data_source = "jhu-csse", + source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", geo_type = "state", time_type = "day", @@ -67,7 +67,7 @@ covidcast( time_values = epirange(20200601, 20200801) ) \%>\% fetch() covidcast( - data_source = "jhu-csse", + source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", geo_type = "state", time_type = "day", diff --git a/man/covidcast_epidata.Rd b/man/covidcast_epidata.Rd index 9f7a69bf..206fb493 100644 --- a/man/covidcast_epidata.Rd +++ b/man/covidcast_epidata.Rd @@ -18,12 +18,3 @@ an instance of covidcast_epidata Creates a helper object that can use auto-complete to help find covidcast sources and signals. } -\examples{ -covidcast_api <- covidcast_epidata() -print(covidcast_api) # print available sources and signals -fb_survey <- covidcast_api$sources$`fb-survey` # tab completion for sources -print(fb_survey) # print a verbose list of available signals -smoothed_cli <- fb_survey$signals$smoothed_cli # tab completion for signals -print(smoothed_cli) -df <- smoothed_cli$call("nation", "us", epirange(20210405, 20210410)) -} diff --git a/man/delphi.Rd b/man/delphi.Rd index f6046c85..7d74f70d 100644 --- a/man/delphi.Rd +++ b/man/delphi.Rd @@ -7,9 +7,9 @@ delphi(system, epiweek) } \arguments{ -\item{system}{string. The system name to fetch.} +\item{system}{character. System name to fetch.} -\item{epiweek}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweek}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/dengue_nowcast.Rd b/man/dengue_nowcast.Rd index 3cfd087e..c03a6020 100644 --- a/man/dengue_nowcast.Rd +++ b/man/dengue_nowcast.Rd @@ -7,9 +7,9 @@ dengue_nowcast(locations, epiweeks) } \arguments{ -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/ecdc_ili.Rd b/man/ecdc_ili.Rd index ea7e2cb4..2919ec99 100644 --- a/man/ecdc_ili.Rd +++ b/man/ecdc_ili.Rd @@ -7,9 +7,9 @@ ecdc_ili(regions, epiweeks, issues = NULL, lag = NULL) } \arguments{ -\item{regions}{character vector. The regions to fetch.} +\item{regions}{character. Regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} \item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the most recent issue is returned. Mutually exclusive with \code{lag}.} diff --git a/man/epidata_call.Rd b/man/epidata_call.Rd index 4e53ab46..6336ddf6 100644 --- a/man/epidata_call.Rd +++ b/man/epidata_call.Rd @@ -85,7 +85,7 @@ In that case a JSON-like nested list structure is returned instead. } \examples{ covidcast( - data_source = "jhu-csse", + source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", time_type = "day", geo_type = "state", diff --git a/man/flusurv.Rd b/man/flusurv.Rd index c03fb648..44cdb3d8 100644 --- a/man/flusurv.Rd +++ b/man/flusurv.Rd @@ -7,9 +7,9 @@ flusurv(locations, epiweeks, issues = NULL, lag = NULL) } \arguments{ -\item{locations}{character vector. Character strings indicating location.} +\item{locations}{character. Character vector indicating location.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} \item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the most recent issue is returned. Mutually exclusive with \code{lag}.} diff --git a/man/fluview.Rd b/man/fluview.Rd index fde8c9c5..0a85b485 100644 --- a/man/fluview.Rd +++ b/man/fluview.Rd @@ -7,11 +7,11 @@ fluview(regions, epiweeks, issues = NULL, lag = NULL, auth = NULL) } \arguments{ -\item{regions}{character vector. The locations to fetch. Can we any string -IDs in national, HHS region, census division, most states and territories, -and so on. Full list link below.} +\item{regions}{character. Locations to fetch. Can we 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}}. The epiweeks to fetch in the form +\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).} diff --git a/man/fluview_clinical.Rd b/man/fluview_clinical.Rd index a43e0908..43d82ce0 100644 --- a/man/fluview_clinical.Rd +++ b/man/fluview_clinical.Rd @@ -7,9 +7,9 @@ fluview_clinical(regions, epiweeks, issues = NULL, lag = NULL) } \arguments{ -\item{regions}{character vector. The regions to fetch.} +\item{regions}{character. Regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch in the form +\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).} diff --git a/man/gft.Rd b/man/gft.Rd index b6c42598..719a10e1 100644 --- a/man/gft.Rd +++ b/man/gft.Rd @@ -7,9 +7,9 @@ gft(locations, epiweeks) } \arguments{ -\item{locations}{character vector. The locations to be fetched.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}} The epiweeks to be fetched.} +\item{epiweeks}{\code{\link{timeset}} Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/kcdc_ili.Rd b/man/kcdc_ili.Rd index fb61c1fe..fdcd7113 100644 --- a/man/kcdc_ili.Rd +++ b/man/kcdc_ili.Rd @@ -7,9 +7,9 @@ kcdc_ili(regions, epiweeks, issues = NULL, lag = NULL) } \arguments{ -\item{regions}{character vector. The regions to be fetched.} +\item{regions}{character. Regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to be fetched.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} \item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the most recent issue is returned. Mutually exclusive with \code{lag}.} diff --git a/man/nidss_dengue.Rd b/man/nidss_dengue.Rd index b451cda8..74cf4ca3 100644 --- a/man/nidss_dengue.Rd +++ b/man/nidss_dengue.Rd @@ -7,9 +7,9 @@ nidss_dengue(locations, epiweeks) } \arguments{ -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetched.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/nidss_flu.Rd b/man/nidss_flu.Rd index 12ad86a8..a5643698 100644 --- a/man/nidss_flu.Rd +++ b/man/nidss_flu.Rd @@ -7,9 +7,9 @@ nidss_flu(regions, epiweeks, issues = NULL, lag = NULL) } \arguments{ -\item{regions}{character vector. The regions to fetch.} +\item{regions}{character. Regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} \item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the most recent issue is returned. Mutually exclusive with \code{lag}.} diff --git a/man/nowcast.Rd b/man/nowcast.Rd index aab7db3a..04c3c0bb 100644 --- a/man/nowcast.Rd +++ b/man/nowcast.Rd @@ -7,9 +7,9 @@ nowcast(locations, epiweeks) } \arguments{ -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/paho_dengue.Rd b/man/paho_dengue.Rd index d6e7b877..452577ba 100644 --- a/man/paho_dengue.Rd +++ b/man/paho_dengue.Rd @@ -7,9 +7,9 @@ paho_dengue(regions, epiweeks, issues = NULL, lag = NULL) } \arguments{ -\item{regions}{character vector. The regions to fetch.} +\item{regions}{character. Regions to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} \item{issues}{\code{\link{timeset}}. Optionally, the issues to fetch. If not set, the most recent issue is returned. Mutually exclusive with \code{lag}.} diff --git a/man/pvt_cdc.Rd b/man/pvt_cdc.Rd index 7d6b6373..ae8f6250 100644 --- a/man/pvt_cdc.Rd +++ b/man/pvt_cdc.Rd @@ -9,7 +9,7 @@ pvt_cdc(auth, locations, epiweeks) \arguments{ \item{auth}{string. Restricted access key (not the same as API key).} -\item{locations}{character vector. Locations to fetch (see docs).} +\item{locations}{character. Locations to fetch.} \item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } diff --git a/man/pvt_dengue_sensors.Rd b/man/pvt_dengue_sensors.Rd index 6212e04c..77dac45e 100644 --- a/man/pvt_dengue_sensors.Rd +++ b/man/pvt_dengue_sensors.Rd @@ -10,11 +10,11 @@ pvt_dengue_sensors(auth, names, locations, epiweeks) \arguments{ \item{auth}{string. Restricted access key (not the same as API key).} -\item{names}{character vector. The list of names to fetch.} +\item{names}{character. Names to fetch.} -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/pvt_ght.Rd b/man/pvt_ght.Rd index 89ede2b1..1c97a019 100644 --- a/man/pvt_ght.Rd +++ b/man/pvt_ght.Rd @@ -9,9 +9,9 @@ pvt_ght(auth, locations, epiweeks, query) \arguments{ \item{auth}{string. Restricted access key (not the same as API key).} -\item{locations}{character vector. The locations to be fetched.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to be fetched.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} \item{query}{string. The query to be fetched.} } diff --git a/man/pvt_norostat.Rd b/man/pvt_norostat.Rd index 5b2fbe32..6c305156 100644 --- a/man/pvt_norostat.Rd +++ b/man/pvt_norostat.Rd @@ -9,9 +9,9 @@ pvt_norostat(auth, locations, epiweeks) \arguments{ \item{auth}{string. Your authentication key.} -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/pvt_quidel.Rd b/man/pvt_quidel.Rd index 5790788b..37fc65aa 100644 --- a/man/pvt_quidel.Rd +++ b/man/pvt_quidel.Rd @@ -9,9 +9,9 @@ pvt_quidel(auth, locations, epiweeks) \arguments{ \item{auth}{string. Restricted access key (not the same as API key).} -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/pvt_sensors.Rd b/man/pvt_sensors.Rd index 93cb8cbc..ce4ad456 100644 --- a/man/pvt_sensors.Rd +++ b/man/pvt_sensors.Rd @@ -9,11 +9,11 @@ pvt_sensors(auth, names, locations, epiweeks) \arguments{ \item{auth}{string. Restricted access key (not the same as API key).} -\item{names}{character vector. The names of the sensors to fetch.} +\item{names}{character. Sensor names to fetch.} -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch.} +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/man/pvt_twitter.Rd b/man/pvt_twitter.Rd index 06435c7a..57449bc4 100644 --- a/man/pvt_twitter.Rd +++ b/man/pvt_twitter.Rd @@ -9,12 +9,11 @@ pvt_twitter(auth, locations, dates = NULL, epiweeks = NULL) \arguments{ \item{auth}{string. Restricted access key (not the same as API key).} -\item{locations}{character vector. The locations to fetch.} +\item{locations}{character. Locations to fetch.} -\item{dates}{\code{\link{timeset}}. The dates to fetch. Mutually exclusive with -\code{epiweeks}.} +\item{dates}{\code{\link{timeset}}. Dates to fetch. Mutually exclusive with \code{epiweeks}.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch. Mutually exclusive with +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Mutually exclusive with \code{dates}.} } \value{ diff --git a/man/wiki.Rd b/man/wiki.Rd index 38344e83..9cfc72de 100644 --- a/man/wiki.Rd +++ b/man/wiki.Rd @@ -7,17 +7,16 @@ wiki(articles, dates = NULL, epiweeks = NULL, hours = NULL, language = "en") } \arguments{ -\item{articles}{character vector. The articles to fetch.} +\item{articles}{character. Articles to fetch.} -\item{dates}{\code{\link{timeset}}. The dates to fetch. Mutually exclusive with -\code{epiweeks}.} +\item{dates}{\code{\link{timeset}}. Dates to fetch. Mutually exclusive with \code{epiweeks}.} -\item{epiweeks}{\code{\link{timeset}}. The epiweeks to fetch. Mutually exclusive with +\item{epiweeks}{\code{\link{timeset}}. Epiweeks to fetch. Mutually exclusive with \code{dates}.} \item{hours}{integer. Optionally, the hours to fetch.} -\item{language}{string. The language to fetch.} +\item{language}{string. Language to fetch.} } \value{ \code{\link{epidata_call}} diff --git a/tests/testthat/test-covidcast.R b/tests/testthat/test-covidcast.R index d239e179..901abdb5 100644 --- a/tests/testthat/test-covidcast.R +++ b/tests/testthat/test-covidcast.R @@ -1,5 +1,5 @@ test_that("covidcast", { - covidcast_api <- covidcast_epidata() + covidcast_api <- epidatr:::covidcast_epidata() expect_identical( covidcast_api$sources$`fb-survey`$signals$smoothed_cli$call("nation", "us", epirange(20210405, 20210410)), covidcast("fb-survey", "smoothed_cli", "nation", "day", "us", epirange(20210405, 20210410)) @@ -8,9 +8,9 @@ test_that("covidcast", { # quite minimal, could probably use some checks that the fields are as desired test_that("dataframe converters", { - res <- covidcast_epidata()$sources %>% as.data.frame() + res <- epidatr:::covidcast_epidata()$sources %>% as.data.frame() expect_identical(class(res), "data.frame") - res <- covidcast_epidata()$signals %>% as.data.frame() + res <- epidatr:::covidcast_epidata()$signals %>% as.data.frame() expect_identical(class(res), "data.frame") }) @@ -26,11 +26,11 @@ test_that("http errors", { local_mocked_bindings( do_request = function(...) readRDS(testthat::test_path("data/test-do_request-httpbin.rds")) ) - expect_error(covidcast_epidata(), class = "http_400") + expect_error(epidatr:::covidcast_epidata(), class = "http_400") }) test_that("name completion", { - all_names <- names(covidcast_epidata()$signals) + all_names <- names(epidatr:::covidcast_epidata()$signals) expect_identical(all_names, all_names) }) diff --git a/tests/testthat/test-endpoints.R b/tests/testthat/test-endpoints.R index 7f9c8f6a..a22b1018 100644 --- a/tests/testthat/test-endpoints.R +++ b/tests/testthat/test-endpoints.R @@ -4,7 +4,7 @@ test_that("basic_epidata_call", { expect_no_error(covid_hosp_facility(hospital_pks = "100075", collection_weeks = epirange(20200101, 20200501))) expect_no_error(covid_hosp_state_timeseries(states = "fl", dates = epirange(20200101, 20200501))) expect_no_error(covidcast_meta()) - expect_no_error(covidcast(data_source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", time_type = "day", geo_type = "state", time_values = epirange(20200601, 20200801), geo_values = "ca,fl")) + expect_no_error(covidcast(source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", time_type = "day", geo_type = "state", time_values = epirange(20200601, 20200801), geo_values = "ca,fl")) expect_no_error(delphi(system = "ec", epiweek = 202006)) expect_no_error(dengue_nowcast(locations = "?", epiweeks = epirange(201501, 202001))) expect_no_error(pvt_dengue_sensors(auth = "yourkey", names = "?", locations = "?", epiweeks = epirange(201501, 202001))) @@ -33,7 +33,7 @@ test_that("basic_epidata_call", { expect_no_error(covid_hosp_facility(hospital_pks = "100075", collection_weeks = epirange(20200101, 20200501)) %>% request_url()) expect_no_error(covid_hosp_state_timeseries(states = "fl", dates = epirange(20200101, 20200501)) %>% request_url()) expect_no_error(covidcast_meta() %>% request_url()) - expect_no_error(covidcast(data_source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", time_type = "day", geo_type = "state", time_values = epirange(20200601, 20200801), geo_values = "ca,fl") %>% request_url()) + expect_no_error(covidcast(source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", time_type = "day", geo_type = "state", time_values = epirange(20200601, 20200801), geo_values = "ca,fl") %>% request_url()) expect_no_error(delphi(system = "ec", epiweek = 202006) %>% request_url()) expect_no_error(dengue_nowcast(locations = "?", epiweeks = epirange(201501, 202001)) %>% request_url()) expect_no_error(pvt_dengue_sensors(auth = "yourkey", names = "?", locations = "?", epiweeks = epirange(201501, 202001)) %>% request_url()) diff --git a/tests/testthat/test-epidatacall.R b/tests/testthat/test-epidatacall.R index fa77520c..aac38439 100644 --- a/tests/testthat/test-epidatacall.R +++ b/tests/testthat/test-epidatacall.R @@ -25,7 +25,7 @@ test_that("request_impl http errors", { test_that("fetch and fetch_tbl", { epidata_call <- covidcast( - data_source = "jhu-csse", + source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", time_type = "day", geo_type = "state", @@ -64,7 +64,7 @@ test_that("fetch and fetch_tbl", { test_that("fetch_tbl warns on non-success", { epidata_call <- covidcast( - data_source = "jhu-csse", + source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", time_type = "day", geo_type = "state", @@ -80,7 +80,6 @@ test_that("fetch_tbl warns on non-success", { content = function(...) NULL, .package = "httr" ) - # TODO: Turn these tests back on, when the API is fully online artificial_warning <- "* This is a warning with a leading asterisk and {braces} to make sure we don't have bulleting/glue bugs." debug_triplet <- readRDS(testthat::test_path("data/test-classic.rds")) %>% jsonlite::fromJSON() %>% diff --git a/vignettes/epidatr.Rmd b/vignettes/epidatr.Rmd index ce4538e4..38f04f2b 100644 --- a/vignettes/epidatr.Rmd +++ b/vignettes/epidatr.Rmd @@ -17,7 +17,7 @@ library(dplyr) ## Basic Usage Fetching some data from the Delphi Epidata API is simple. -First, we find the function for the endpoint we need, then, we find the right arguments, and finally, we `fetch` a tibble with the data. +First, we find the function for the endpoint we need, then we find the right arguments, and finally we `fetch` a tibble with the data. ```{r} epicall <- covidcast("fb-survey", "smoothed_cli", "state", "day", "pa", epirange(20210405, 20210410)) @@ -25,23 +25,24 @@ epicall %>% fetch() ``` The [Delphi Epidata API documentation](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html) has more information on the available endpoints and arguments. +Examples queries with all the endpoint functions available in this package are given below. -## Advanced Usage +## Advanced Usage (Experimental) -You can also use `covidcast_epidata` function to get an API object, which can help with finding sources and functions without leaving R. -Using tab completion after typing `epi$signals$` below, you can see all the available sources and signals in the API, with the format `source:signal`. +You can use `covidcast_epidata` to get help with finding sources and functions without leaving R. +Using tab completion after typing `epidata$signals$` below, you can see all the available sources and signals in the API, with the format `source:signal`. Note that some signal names have dashes in them, so to access them we rely on the backtick operator. ```{r} -epidata <- covidcast_epidata() +epidata <- epidatr:::covidcast_epidata() epidata$signals -epidata$signals$`fb-survey.fb-survey:smoothed_cli` +epidata$signals$`fb-survey:smoothed_cli` ``` From there, you can construct a call analogous to the one above, but using the API object instead of the functions directly. ```{r} -epicall <- epidata$signals$`fb-survey.fb-survey:smoothed_cli`$call("state", "pa", epirange(20210405, 20210410)) +epicall <- epidata$signals$`fb-survey:smoothed_cli`$call("state", "pa", epirange(20210405, 20210410)) epicall %>% fetch() ``` @@ -51,13 +52,14 @@ epicall %>% fetch() ### COVIDcast Main Endpoint -All of these signals use the command `covidcast()`, with variation in which source and signal are used. +API docs: -Data Sources and Signals documentation: + +County geo_values are [FIPS codes](https://en.wikipedia.org/wiki/List_of_United_States_FIPS_codes_by_county) and are discussed in the API docs [here](https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html). The example above is for Orange County, California. ```{r} covidcast( - data_source = "fb-survey", + source = "fb-survey", signals = "smoothed_accept_covid_vaccine", geo_type = "county", time_type = "day", @@ -66,12 +68,11 @@ covidcast( ) %>% fetch() ``` -County geo_values are [FIPS codes](https://en.wikipedia.org/wiki/List_of_United_States_FIPS_codes_by_county) and are discussed more here: . The example above is for Orange County, California. -Since `covidcast` is an endpoint which supports `*`, here is an example of its use: +The `covidcast` endpoint supports `*` in its time and geo fields: ```{r} covidcast( - data_source = "fb-survey", + source = "fb-survey", signals = "smoothed_accept_covid_vaccine", geo_type = "county", time_type = "day",