From ffc5adb68750d898537136041273ab27f67c5f4b Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 13:52:12 -0500 Subject: [PATCH 01/17] adding non-returned query arguments --- NAMESPACE | 1 + R/check_non_returned.R | 194 ++++++++++++++++++++++ R/get_ogc_data.R | 55 ++---- R/read_waterdata_continuous.R | 21 ++- R/read_waterdata_daily.R | 24 ++- man/make_monitoring_location_arguments.Rd | 149 +++++++++++++++++ man/read_waterdata_continuous.Rd | 17 +- man/read_waterdata_daily.Rd | 15 ++ man/read_wateruse.Rd | 2 +- 9 files changed, 430 insertions(+), 48 deletions(-) create mode 100644 R/check_non_returned.R create mode 100644 man/make_monitoring_location_arguments.Rd diff --git a/NAMESPACE b/NAMESPACE index f4a171a2..5ec04a04 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -23,6 +23,7 @@ export(importWQP) export(importWaterML1) export(importWaterML2) export(is_dataRetrieval_user) +export(make_monitoring_location_arguments) export(pCodeToName) export(parameterCdFile) export(parse_WQP) diff --git a/R/check_non_returned.R b/R/check_non_returned.R new file mode 100644 index 00000000..da0b4d47 --- /dev/null +++ b/R/check_non_returned.R @@ -0,0 +1,194 @@ +#' Check for arguments that can be queried but not returned +#' +#' @param agency_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$agency_code$description` +#' @param agency_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$agency_name$description` +#' @param monitoring_location_number `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$monitoring_location_number$description` +#' @param monitoring_location_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$monitoring_location_name$description` +#' @param district_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$district_code$description` +#' @param country_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$country_code$description` +#' @param country_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$country_name$description` +#' @param state_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$state_code$description` +#' @param state_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$state_name$description` +#' @param county_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$county_code$description` +#' @param county_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$county_name$description` +#' @param minor_civil_division_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$minor_civil_division_code$description` +#' @param site_type_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$site_type_code$description` +#' @param site_type `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$site_type$description` +#' @param hydrologic_unit_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$hydrologic_unit_code$description` +#' @param basin_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$basin_code$description` +#' @param altitude `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$altitude$description` +#' @param altitude_accuracy `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$altitude_accuracy$description` +#' @param altitude_method_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$altitude_method_code$description` +#' @param altitude_method_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$altitude_method_name$description` +#' @param vertical_datum `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$vertical_datum$description` +#' @param vertical_datum_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$vertical_datum_name$description` +#' @param horizontal_positional_accuracy_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$horizontal_positional_accuracy_code$description` +#' @param horizontal_positional_accuracy `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$agency_code$description` +#' @param horizontal_position_method_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$horizontal_position_method_code$description` +#' @param horizontal_position_method_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$horizontal_position_method_name$description` +#' @param original_horizontal_datum `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$original_horizontal_datum$description` +#' @param original_horizontal_datum_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$original_horizontal_datum_name$description` +#' @param drainage_area `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$drainage_area$description` +#' @param contributing_drainage_area `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$contributing_drainage_area$description` +#' @param time_zone_abbreviation `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$time_zone_abbreviation$description` +#' @param uses_daylight_savings `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$agency_code$description` +#' @param construction_date `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$construction_date$description` +#' @param aquifer_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$aquifer_code$description` +#' @param national_aquifer_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$national_aquifer_code$description` +#' @param aquifer_type_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$agency_code$description` +#' @param well_constructed_depth `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$well_constructed_depth$description` +#' @param hole_constructed_depth `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$hole_constructed_depth$description` +#' @param depth_source_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$depth_source_code$description` +#' @param data_gap_interval `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$data_gap_interval$description` +#' @param \dots Not used. Used to make sure the user isn't passing in arguments that aren't available. +#' @param check_arguments Logical. Used to decide if the arguments passed in are available or not. The +#' default is `FALSE`. Using `TRUE` will make two calls to the API, so if you are concerted +#' with minimizing API calls, keep this value as `FALSE`. If you are concerned with +#' making sure your calls are accepted by the service, set to `TRUE`. +#' @export +#' @examples +#' +#' make_monitoring_location_arguments(service = "daily", agency_name = "USGS") +#' make_monitoring_location_arguments(service = "field-measurements", +#' state_name = c("Ohio", "Wisconsin")) +make_monitoring_location_arguments <- function( + service = c("daily"), + agency_code = NA_character_, + agency_name = NA_character_, + monitoring_location_number = NA_character_, + monitoring_location_name = NA_character_, + district_code = NA_character_, + country_code = NA_character_, + country_name = NA_character_, + state_code = NA_character_, + state_name = NA_character_, + county_code = NA_character_, + county_name = NA_character_, + minor_civil_division_code = NA_character_, + site_type_code = NA_character_, + site_type = NA_character_, + hydrologic_unit_code = NA_character_, + basin_code = NA_character_, + altitude = NA_character_, + altitude_accuracy = NA_character_, + altitude_method_code = NA_character_, + altitude_method_name = NA_character_, + vertical_datum = NA_character_, + vertical_datum_name = NA_character_, + horizontal_positional_accuracy_code = NA_character_, + horizontal_positional_accuracy = NA_character_, + horizontal_position_method_code = NA_character_, + horizontal_position_method_name = NA_character_, + original_horizontal_datum = NA_character_, + original_horizontal_datum_name = NA_character_, + drainage_area = NA_character_, + contributing_drainage_area = NA_character_, + time_zone_abbreviation = NA_character_, + uses_daylight_savings = NA_character_, + construction_date = NA_character_, + aquifer_code = NA_character_, + national_aquifer_code = NA_character_, + aquifer_type_code = NA_character_, + well_constructed_depth = NA_character_, + hole_constructed_depth = NA_character_, + depth_source_code = NA_character_, + data_gap_interval = NA_character_, + ..., + check_arguments = FALSE +) { + # Make sure no one passes in an argument that's not suppose to be there + rlang::check_dots_empty() + service_with_extra_queries <- c( + "daily", + "latest-continuous", + "field-measurements", + "latest-daily", + "latest-field-measurements", + "continuous", + "peaks" + ) + match.arg(service, choices = service_with_extra_queries, several.ok = FALSE) + + args <- mget(names(formals())) + args[["..."]] <- NULL + args[["service"]] <- NULL + args[["check_arguments"]] <- NULL + + n_args <- names(args) + + lapply(n_args, function(x) { + check_character(args[[x]], x) + }) + + if (check_arguments) { + # think about if we want this as an option + # don't want to waste a lot of hits to the API if people are + # running into their token limits + properties <- dataRetrieval::get_ogc_params(service) + queryables <- check_OGC_requests(endpoint = service, type = "queryables") + non_returned <- queryables$properties[ + !names(queryables$properties) %in% names(properties) + ] + + args_not_available <- args[!names(args) %in% names(non_returned)] + if (length(args_not_available) > 0) { + message( + "The ", + service, + " service doesn't accept: ", + paste0(names(args_not_available), collapse = ", "), + "." + ) + message("Those arguments will be ignored.") + } + + args <- args[names(args) %in% names(non_returned)] + } + + return(args) +} + +cleanup_arguments <- function(args, monitoring_location_arguments, service) { + query_args <- do.call( + make_monitoring_location_arguments, + c(monitoring_location_arguments, service = service) + ) + + args[["monitoring_location_arguments"]] <- NULL + + args <- c(args, query_args) + + return(args) +} + +check_character <- function(x, name) { + if (!is.null(x)) { + if (all(!is.na(x) & !is.character(x))) { + stop(paste(name, "should be a character")) + } + } +} + +check_numeric <- function(x, name) { + if (!is.null(x)) { + if (all(!is.na(x) & !is.numeric(x))) { + stop(paste(name, "should be a numeric")) + } + } +} + +check_integer <- function(x, name) { + if (!is.null(x)) { + if (all(!is.na(x) & !is.numeric(x))) { + stop(paste(name, "should be a integer")) + } + } +} + +check_logical <- function(x, name) { + if (!is.null(x)) { + if (all(!is.na(x) & !is.logical(x))) { + stop(paste(name, "should be a logical (TRUE/FALSE)")) + } + } +} diff --git a/R/get_ogc_data.R b/R/get_ogc_data.R index 4b01df23..0c929af2 100644 --- a/R/get_ogc_data.R +++ b/R/get_ogc_data.R @@ -54,13 +54,14 @@ get_ogc_data <- function(args, output_id, service, base = "OGC") { return_list <- walk_pages(req) } - return_list <- deal_with_empty(return_list = return_list, - properties = args[["properties"]], - service = service, - skipGeometry = isTRUE(args[["skipGeometry"]]), - convertType = args[["convertType"]], - no_paging = no_paging, - base = base + return_list <- deal_with_empty( + return_list = return_list, + properties = args[["properties"]], + service = service, + skipGeometry = isTRUE(args[["skipGeometry"]]), + convertType = args[["convertType"]], + no_paging = no_paging, + base = base ) return_list <- rejigger_cols(return_list, args[["properties"]], output_id) @@ -223,35 +224,11 @@ check_arguments_non_api <- function( chunk_size, ... ) { - if (!is.null(convertType)) { - if (!is.na(convertType) & !is.logical(convertType)) { - stop("convertType should be a logical TRUE/FALSE") - } - } - - if (!is.null(no_paging)) { - if (!is.na(no_paging) & !is.logical(no_paging)) { - stop("no_paging should be a logical TRUE/FALSE") - } - } - - if (!is.null(attach_request)) { - if (!is.na(attach_request) & !is.logical(attach_request)) { - stop("attach_request should be a logical TRUE/FALSE") - } - } - - if (!is.null(limit)) { - if (!is.na(limit) & !is.numeric(limit)) { - stop("limit should be an integer") - } - } - - if (!is.null(chunk_size)) { - if (!is.na(chunk_size) & !is.numeric(chunk_size)) { - stop("chunk_size should be an integer") - } - } + check_logical(convertType, "convertType") + check_logical(no_paging, "no_paging") + check_logical(attach_request, "attach_request") + check_integer(limit, "limit") + check_integer(chunk_size, "chunk_size") } #' Check other arguments @@ -271,11 +248,7 @@ check_arguments_non_api <- function( #' #' @keywords internal check_arguments_api <- function(bbox, skipGeometry) { - if (!is.null(skipGeometry)) { - if (!is.na(skipGeometry) & !is.logical(skipGeometry)) { - stop("skipGeometry should be a logical TRUE/FALSE") - } - } + check_logical(skipGeometry, "skipGeometry") if (!is.null(bbox)) { if (!all(is.na(bbox))) { diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index eff8cc87..c94bcec8 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -31,8 +31,10 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("continuous", "continuous_id")`. #' The default (`NA`) will return all columns of the data. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. +#' @param monitoring_location_arguments A list of arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. +#' @seealso [make_monitoring_location_arguments()] #' @inheritParams check_arguments_non_api #' @inheritParams check_arguments_api #' @@ -76,6 +78,12 @@ #' parameter_code = c("00060", "72019"), #' last_modified = "P7D") #' +#' dane <- read_waterdata_continuous(monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County"), +#' parameter_code = "00060", +#' time = "P1D") +#' #' # how to split up request into roughly 3 year chunks #' #' site <- "USGS-0208458892" @@ -122,6 +130,9 @@ read_waterdata_continuous <- function( time = NA_character_, skipGeometry = TRUE, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments( + service = "continuous" + ), ..., convertType = getOption("dataRetrieval.convertType"), limit = getOption("dataRetrieval.limit"), @@ -135,6 +146,12 @@ read_waterdata_continuous <- function( args <- mget(names(formals())) + args <- cleanup_arguments( + args = args, + monitoring_location_arguments = monitoring_location_arguments, + service = service + ) + return_list <- get_ogc_data(args, output_id, service) attr(return_list$time, "tzone") <- "UTC" diff --git a/R/read_waterdata_daily.R b/R/read_waterdata_daily.R index 13922ae1..6d918268 100644 --- a/R/read_waterdata_daily.R +++ b/R/read_waterdata_daily.R @@ -25,10 +25,12 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("daily", "daily_id")`. #' The default (`NA`) will return all columns of the data. -#' +#' @param monitoring_location_arguments A list of arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api -#' +#' @seealso [make_monitoring_location_arguments()] #' @inherit read_waterdata_continuous details #' #' @examplesIf is_dataRetrieval_user() @@ -73,6 +75,13 @@ #' dv_data_no_request <- read_waterdata_daily(monitoring_location_id = site, #' parameter_code = "00060", #' time = c("2021-01-01", "2022-01-01")) +#' +#' dv_dane <- read_waterdata_daily(monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County"), +#' parameter_code = "00060", +#' time = "P7D") +#' #' } read_waterdata_daily <- function( monitoring_location_id = NA_character_, @@ -88,6 +97,9 @@ read_waterdata_daily <- function( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments( + service = "daily" + ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -98,8 +110,14 @@ read_waterdata_daily <- function( service <- "daily" output_id <- "daily_id" rlang::check_dots_empty() - args <- mget(names(formals())) + + args <- cleanup_arguments( + args = args, + monitoring_location_arguments = monitoring_location_arguments, + service = service + ) + return_list <- get_ogc_data(args, output_id, service, base = "OGC") return(return_list) diff --git a/man/make_monitoring_location_arguments.Rd b/man/make_monitoring_location_arguments.Rd new file mode 100644 index 00000000..0668ce21 --- /dev/null +++ b/man/make_monitoring_location_arguments.Rd @@ -0,0 +1,149 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/check_non_returned.R +\name{make_monitoring_location_arguments} +\alias{make_monitoring_location_arguments} +\title{Check for arguments that can be queried but not returned} +\usage{ +make_monitoring_location_arguments( + service = c("daily"), + agency_code = NA_character_, + agency_name = NA_character_, + monitoring_location_number = NA_character_, + monitoring_location_name = NA_character_, + district_code = NA_character_, + country_code = NA_character_, + country_name = NA_character_, + state_code = NA_character_, + state_name = NA_character_, + county_code = NA_character_, + county_name = NA_character_, + minor_civil_division_code = NA_character_, + site_type_code = NA_character_, + site_type = NA_character_, + hydrologic_unit_code = NA_character_, + basin_code = NA_character_, + altitude = NA_character_, + altitude_accuracy = NA_character_, + altitude_method_code = NA_character_, + altitude_method_name = NA_character_, + vertical_datum = NA_character_, + vertical_datum_name = NA_character_, + horizontal_positional_accuracy_code = NA_character_, + horizontal_positional_accuracy = NA_character_, + horizontal_position_method_code = NA_character_, + horizontal_position_method_name = NA_character_, + original_horizontal_datum = NA_character_, + original_horizontal_datum_name = NA_character_, + drainage_area = NA_character_, + contributing_drainage_area = NA_character_, + time_zone_abbreviation = NA_character_, + uses_daylight_savings = NA_character_, + construction_date = NA_character_, + aquifer_code = NA_character_, + national_aquifer_code = NA_character_, + aquifer_type_code = NA_character_, + well_constructed_depth = NA_character_, + hole_constructed_depth = NA_character_, + depth_source_code = NA_character_, + data_gap_interval = NA_character_, + ..., + check_arguments = FALSE +) +} +\arguments{ +\item{agency_code}{The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/agency-codes/items}.} + +\item{agency_name}{The name of the agency that is reporting the data.} + +\item{monitoring_location_number}{Each monitoring location in the USGS data base has a unique 8- to 15-digit identification number.} + +\item{monitoring_location_name}{This is the official name of the monitoring location in the database. For well information this can be a district-assigned local number.} + +\item{district_code}{The Water Science Centers (WSCs) across the United States use the FIPS state code as the district code. In some case, monitoring locations and samples may be managed by a water science center that is adjacent to the state in which the monitoring location actually resides. For example a monitoring location may have a district code of 30 which translates to Montana, but the state code could be 56 for Wyoming because that is where the monitoring location actually is located.} + +\item{country_code}{The code for the country in which the monitoring location is located.} + +\item{country_name}{The name of the country in which the monitoring location is located.} + +\item{state_code}{State code. A \href{https://www2.census.gov/geo/docs/reference/state.txt}{two-digit ANSI code} (formerly FIPS code) as defined by the American National Standards Institute, to define States and equivalents. A three-digit ANSI code is used to define counties and county equivalents. \href{https://www.census.gov/library/reference/code-lists/ansi.html#states}{A lookup table is available.} The only countries with political subdivisions other than the US are Mexico and Canada. The Mexican states have US state codes ranging from 81-86 and Canadian provinces have state codes ranging from 90-98.} + +\item{state_name}{The name of the state or state equivalent in which the monitoring location is located.} + +\item{county_code}{The code for the county or county equivalent (parish, borough, etc.) in which the monitoring location is located. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/counties/items}.} + +\item{county_name}{The name of the county or county equivalent (parish, borough, etc.) in which the monitoring location is located. [A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/counties/items}.} + +\item{minor_civil_division_code}{Codes for primary governmental or administrative divisions of the county or county equivalent in which the monitoring location is located.} + +\item{site_type_code}{A code describing the hydrologic setting of the monitoring location. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/site-types/items}.} + +\item{site_type}{A description of the hydrologic setting of the monitoring location. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/site-types/items}.} + +\item{hydrologic_unit_code}{The hydrologic unit code (HUC) for the monitoring location. Supports prefix matching — querying with a shorter HUC (e.g. "04") matches all locations within that hydrologic region.} + +\item{basin_code}{The Basin Code or "drainage basin code" is a two-digit code that further subdivides the 8-digit hydrologic-unit code. The drainage basin code is defined by the USGS State Office where the monitoring location is located.} + +\item{altitude}{Altitude of the monitoring location referenced to the specified Vertical Datum.} + +\item{altitude_accuracy}{Accuracy of the altitude, in feet. An accuracy of +/- 0.1 foot would be entered as “.1”. Many altitudes are interpolated from the contours on topographic maps; accuracies determined in this way are generally entered as one-half of the contour interval.} + +\item{altitude_method_code}{Codes representing the method used to measure altitude.} + +\item{altitude_method_name}{The name of the method used to measure altitude.} + +\item{vertical_datum}{The datum used to determine altitude and vertical position at the monitoring location. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/altitude-datums/items}.} + +\item{vertical_datum_name}{The datum used to determine altitude and vertical position at the monitoring location. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/altitude-datums/items}.} + +\item{horizontal_positional_accuracy_code}{Indicates the accuracy of the latitude longitude values. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-accuracy-codes/items}.} + +\item{horizontal_positional_accuracy}{The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/agency-codes/items}.} + +\item{horizontal_position_method_code}{Indicates the method used to determine latitude longitude values. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-method-codes/items}.} + +\item{horizontal_position_method_name}{Indicates the method used to determine latitude longitude values. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-method-codes/items}.} + +\item{original_horizontal_datum}{Coordinates are published in EPSG:4326 / WGS84 / World Geodetic System 1984. This field indicates the original datum used to determine coordinates before they were converted. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-datum-codes/items}.} + +\item{original_horizontal_datum_name}{Coordinates are published in EPSG:4326 / WGS84 / World Geodetic System 1984. This field indicates the original datum used to determine coordinates before they were converted. A list of codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/coordinate-datum-codes/items}.} + +\item{drainage_area}{The area enclosed by a topographic divide from which direct surface runoff from precipitation normally drains by gravity into the stream above that point.} + +\item{contributing_drainage_area}{The contributing drainage area of a lake, stream, wetland, or estuary monitoring location, in square miles. This item should be present only if the contributing area is different from the total drainage area. This situation can occur when part of the drainage area consists of very porous soil or depressions that either allow all runoff to enter the groundwater or traps the water in ponds so that rainfall does not contribute to runoff. A transbasin diversion can also affect the total drainage area.} + +\item{time_zone_abbreviation}{A short code describing the time zone used by a monitoring location.} + +\item{uses_daylight_savings}{The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/agency-codes/items}.} + +\item{construction_date}{Date the well was completed.} + +\item{aquifer_code}{Local aquifers in the USGS water resources data base are identified by a geohydrologic unit code (a three-digit number related to the age of the formation, followed by a 4 or 5 character abbreviation for the geologic unit or aquifer name).} + +\item{national_aquifer_code}{National aquifers are the principal aquifers or aquifer systems in the United States, defined as regionally extensive aquifers or aquifer systems that have the potential to be used as a source of potable water. Not all groundwater monitoring locations can be associated with a National Aquifer. Such monitoring locations will not be retrieved using this search criteria. A list of National aquifer codes and names is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/national-aquifer-codes/items}.} + +\item{aquifer_type_code}{The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/agency-codes/items}.} + +\item{well_constructed_depth}{The depth of the finished well, in feet below land surface datum. Note: Not all groundwater monitoring locations have information on Well Depth. Such monitoring locations will not be retrieved using this search criteria.} + +\item{hole_constructed_depth}{The total depth to which the hole is drilled, in feet below land surface datum. Note: Not all groundwater monitoring locations have information on Hole Depth. Such monitoring locations will not be retrieved using this search criteria.} + +\item{depth_source_code}{A code indicating the source of water-level data.} + +\item{data_gap_interval}{The time interval threshold used for gap detection in the time series.} + +\item{\dots}{Not used. Used to make sure the user isn't passing in arguments that aren't available.} + +\item{check_arguments}{Logical. Used to decide if the arguments passed in are available or not. The +default is \code{FALSE}. Using \code{TRUE} will make two calls to the API, so if you are concerted +with minimizing API calls, keep this value as \code{FALSE}. If you are concerned with +making sure your calls are accepted by the service, set to \code{TRUE}.} +} +\description{ +Check for arguments that can be queried but not returned +} +\examples{ + +make_monitoring_location_arguments(service = "daily", agency_name = "USGS") +make_monitoring_location_arguments(service = "field-measurements", + state_name = c("Ohio", "Wisconsin")) +} diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index cb48d15b..fd1ae7eb 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -17,6 +17,8 @@ read_waterdata_continuous( time = NA_character_, skipGeometry = TRUE, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments(service = + "continuous"), ..., convertType = getOption("dataRetrieval.convertType"), limit = getOption("dataRetrieval.limit"), @@ -90,7 +92,11 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids.} + +\item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. @@ -170,6 +176,12 @@ multi_site2 <- read_waterdata_continuous(monitoring_location_id = c("USGS-45160 parameter_code = c("00060", "72019"), last_modified = "P7D") +dane <- read_waterdata_continuous(monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County"), + parameter_code = "00060", + time = "P1D") + # how to split up request into roughly 3 year chunks site <- "USGS-0208458892" @@ -205,3 +217,6 @@ time_df <- data.frame(start = time_chunks[-length(time_chunks)], } \dontshow{\}) # examplesIf} } +\seealso{ +\code{\link[=make_monitoring_location_arguments]{make_monitoring_location_arguments()}} +} diff --git a/man/read_waterdata_daily.Rd b/man/read_waterdata_daily.Rd index 9c0efdd0..051fe248 100644 --- a/man/read_waterdata_daily.Rd +++ b/man/read_waterdata_daily.Rd @@ -18,6 +18,7 @@ read_waterdata_daily( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments(service = "daily"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -95,6 +96,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids.} + \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} @@ -187,6 +192,16 @@ options("dataRetrieval.attach_request" = FALSE) dv_data_no_request <- read_waterdata_daily(monitoring_location_id = site, parameter_code = "00060", time = c("2021-01-01", "2022-01-01")) + +dv_dane <- read_waterdata_daily(monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County"), + parameter_code = "00060", + time = "P7D") + } \dontshow{\}) # examplesIf} } +\seealso{ +\code{\link[=make_monitoring_location_arguments]{make_monitoring_location_arguments()}} +} diff --git a/man/read_wateruse.Rd b/man/read_wateruse.Rd index f475e0e5..96affc46 100644 --- a/man/read_wateruse.Rd +++ b/man/read_wateruse.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/read_waterdata_use.R +% Please edit documentation in R/read_wateruse.R \name{read_wateruse} \alias{read_wateruse} \title{Get USGS Water Use Data} From cce5080357bfc408d449b96afb8a6b714dccdfea Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 15:02:11 -0500 Subject: [PATCH 02/17] add service --- R/check_non_returned.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/check_non_returned.R b/R/check_non_returned.R index da0b4d47..32e4c089 100644 --- a/R/check_non_returned.R +++ b/R/check_non_returned.R @@ -1,5 +1,8 @@ #' Check for arguments that can be queried but not returned #' +#' @param service Endpoint to check arguments against. Possible values are +#' "daily", "latest-continuous", "field-measurements", "latest-daily", +#' "latest-field-measurements", "continuous", "peaks". #' @param agency_code `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$agency_code$description` #' @param agency_name `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$agency_name$description` #' @param monitoring_location_number `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$monitoring_location_number$description` From 93383c5af36232d82f9b211ebd6e7077ec8ef0e6 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 15:20:01 -0500 Subject: [PATCH 03/17] more functions with queries --- R/read_waterdata_continuous.R | 12 +++++++----- R/read_waterdata_field_measurements.R | 22 ++++++++++++++++++++++ R/read_waterdata_latest_continuous.R | 14 ++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index c94bcec8..842aa118 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -78,11 +78,13 @@ #' parameter_code = c("00060", "72019"), #' last_modified = "P7D") #' -#' dane <- read_waterdata_continuous(monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County"), -#' parameter_code = "00060", -#' time = "P1D") +#' dane <- read_waterdata_continuous( +#' monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County" +#' ), +#' parameter_code = "00060", +#' time = "P1D") #' #' # how to split up request into roughly 3 year chunks #' diff --git a/R/read_waterdata_field_measurements.R b/R/read_waterdata_field_measurements.R index 25d82256..99a45863 100644 --- a/R/read_waterdata_field_measurements.R +++ b/R/read_waterdata_field_measurements.R @@ -37,8 +37,12 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("field-measurements", "field_measurement_id")`. #' The default (`NA`) will return all columns of the data. +#' @param monitoring_location_arguments A list of arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api +#' @seealso [make_monitoring_location_arguments()] #' #' @inherit read_waterdata_continuous details #' @@ -81,6 +85,14 @@ #' time = "2024-07-01T00:00:00Z/..", #' parameter_code = "00060") #' +#' dane <- read_waterdata_field_measurements( +#' monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County" +#' ), +#' parameter_code = "00060", +#' time = "P30D") +#' #' #' } read_waterdata_field_measurements <- function( @@ -103,6 +115,9 @@ read_waterdata_field_measurements <- function( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments( + service = "field-measurements" + ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -115,6 +130,13 @@ read_waterdata_field_measurements <- function( rlang::check_dots_empty() args <- mget(names(formals())) + + args <- cleanup_arguments( + args = args, + monitoring_location_arguments = monitoring_location_arguments, + service = service + ) + return_list <- get_ogc_data(args, output_id, service) return(return_list) diff --git a/R/read_waterdata_latest_continuous.R b/R/read_waterdata_latest_continuous.R index e450561a..948ba63e 100644 --- a/R/read_waterdata_latest_continuous.R +++ b/R/read_waterdata_latest_continuous.R @@ -23,8 +23,12 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("latest-continuous", "latest_continuous_id")`. #' The default (`NA`) will return all columns of the data. +#' @param monitoring_location_arguments A list of arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api +#' @seealso [make_monitoring_location_arguments()] #' #' @inherit read_waterdata_continuous details #' @examplesIf is_dataRetrieval_user() @@ -74,6 +78,9 @@ read_waterdata_latest_continuous <- function( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments( + service = "latest-continuous" + ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -86,6 +93,13 @@ read_waterdata_latest_continuous <- function( rlang::check_dots_empty() args <- mget(names(formals())) + + args <- cleanup_arguments( + args = args, + monitoring_location_arguments = monitoring_location_arguments, + service = service + ) + return_list <- get_ogc_data(args, output_id, service) return(return_list) From 1cb928e32449f5bb30667a324f0691d85e79018d Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 15:37:38 -0500 Subject: [PATCH 04/17] more functions with extra queries --- R/read_waterdata_latest_continuous.R | 8 ++++++++ R/read_waterdata_latest_daily.R | 22 ++++++++++++++++++++++ R/read_waterdata_peaks.R | 21 +++++++++++++++++++++ man/make_monitoring_location_arguments.Rd | 4 ++++ man/read_waterdata_continuous.Rd | 12 +++++++----- man/read_waterdata_field_measurements.Rd | 17 +++++++++++++++++ man/read_waterdata_latest_continuous.Rd | 17 +++++++++++++++++ man/read_waterdata_latest_daily.Rd | 17 +++++++++++++++++ man/read_waterdata_peaks.Rd | 15 +++++++++++++++ 9 files changed, 128 insertions(+), 5 deletions(-) diff --git a/R/read_waterdata_latest_continuous.R b/R/read_waterdata_latest_continuous.R index 948ba63e..f3575dc5 100644 --- a/R/read_waterdata_latest_continuous.R +++ b/R/read_waterdata_latest_continuous.R @@ -64,6 +64,14 @@ #' parameter_code = c("00060", "72019"), #' last_modified = "P7D") #' +#' dane <- read_waterdata_latest_continuous( +#' monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County" +#' ), +#' parameter_code = "00060", +#' time = "P1D") +#' #' } read_waterdata_latest_continuous <- function( monitoring_location_id = NA_character_, diff --git a/R/read_waterdata_latest_daily.R b/R/read_waterdata_latest_daily.R index 85bc6c11..6c67904b 100644 --- a/R/read_waterdata_latest_daily.R +++ b/R/read_waterdata_latest_daily.R @@ -25,9 +25,13 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("latest-daily", "latest_daily_id")`. #' The default (`NA`) will return all columns of the data. +#' @param monitoring_location_arguments A list of arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. #' #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api +#' @seealso [make_monitoring_location_arguments()] #' @inherit read_waterdata_continuous details #' #' @examplesIf is_dataRetrieval_user() @@ -56,6 +60,14 @@ #' "USGS-01645000"), #' parameter_code = c("00060", "00010")) #' +#' dane <- read_waterdata_latest_daily( +#' monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County" +#' ), +#' parameter_code = "00060", +#' time = "P7D") +#' #' } read_waterdata_latest_daily <- function( monitoring_location_id = NA_character_, @@ -71,6 +83,9 @@ read_waterdata_latest_daily <- function( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments( + service = "latest-daily" + ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -83,6 +98,13 @@ read_waterdata_latest_daily <- function( rlang::check_dots_empty() args <- mget(names(formals())) + + args <- cleanup_arguments( + args = args, + monitoring_location_arguments = monitoring_location_arguments, + service = service + ) + return_list <- get_ogc_data(args, output_id, service) return(return_list) diff --git a/R/read_waterdata_peaks.R b/R/read_waterdata_peaks.R index 3fb61447..d49cf9f9 100644 --- a/R/read_waterdata_peaks.R +++ b/R/read_waterdata_peaks.R @@ -36,8 +36,12 @@ #' or whether to set those dates to `NA` (`FALSE`). Peaks with uncertain days #' are stored on the first of the month, and those with uncertain #' month stored on January 1. Default is `FALSE`. +#' @param monitoring_location_arguments A list of arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api +#' @seealso [make_monitoring_location_arguments()] #' #' @inherit read_waterdata_continuous details #' @@ -54,6 +58,13 @@ #' monitoring_location_id = wi_peaks$monitoring_location_id[1], #' parameter_code = "00060") #' +#' dane <- read_waterdata_peaks( +#' monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County" +#' ), +#' parameter_code = "00060") +#' #' incomplete_dates_not_allowed <- read_waterdata_peaks( #' monitoring_location_id = "USGS-06334330", #' parameter_code = "00060") @@ -83,6 +94,9 @@ read_waterdata_peaks <- function( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments( + service = "peaks" + ), ..., allow_incomplete_dates = FALSE, convertType = getOption("dataRetrieval.convertType"), @@ -96,6 +110,13 @@ read_waterdata_peaks <- function( rlang::check_dots_empty() args <- mget(names(formals())) + + args <- cleanup_arguments( + args = args, + monitoring_location_arguments = monitoring_location_arguments, + service = service + ) + args[["allow_incomplete_dates"]] <- NULL return_list <- get_ogc_data(args, output_id, service) diff --git a/man/make_monitoring_location_arguments.Rd b/man/make_monitoring_location_arguments.Rd index 0668ce21..ebe061f2 100644 --- a/man/make_monitoring_location_arguments.Rd +++ b/man/make_monitoring_location_arguments.Rd @@ -51,6 +51,10 @@ make_monitoring_location_arguments( ) } \arguments{ +\item{service}{Endpoint to check arguments against. Possible values are +"daily", "latest-continuous", "field-measurements", "latest-daily", +"latest-field-measurements", "continuous", "peaks".} + \item{agency_code}{The agency that is reporting the data. Agency codes are fixed values assigned by the National Water Information System (NWIS). A list of agency codes is available at \url{https://api.waterdata.usgs.gov/ogcapi/v0/collections/agency-codes/items}.} \item{agency_name}{The name of the agency that is reporting the data.} diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index fd1ae7eb..83b184ea 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -176,11 +176,13 @@ multi_site2 <- read_waterdata_continuous(monitoring_location_id = c("USGS-45160 parameter_code = c("00060", "72019"), last_modified = "P7D") -dane <- read_waterdata_continuous(monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County"), - parameter_code = "00060", - time = "P1D") +dane <- read_waterdata_continuous( + monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County" + ), + parameter_code = "00060", + time = "P1D") # how to split up request into roughly 3 year chunks diff --git a/man/read_waterdata_field_measurements.Rd b/man/read_waterdata_field_measurements.Rd index 95271b34..e07b9a99 100644 --- a/man/read_waterdata_field_measurements.Rd +++ b/man/read_waterdata_field_measurements.Rd @@ -24,6 +24,8 @@ read_waterdata_field_measurements( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments(service = + "field-measurements"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -118,6 +120,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids.} + \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} @@ -206,7 +212,18 @@ surface_water <- read_waterdata_field_measurements( time = "2024-07-01T00:00:00Z/..", parameter_code = "00060") +dane <- read_waterdata_field_measurements( + monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County" + ), + parameter_code = "00060", + time = "P30D") + } \dontshow{\}) # examplesIf} } +\seealso{ +\code{\link[=make_monitoring_location_arguments]{make_monitoring_location_arguments()}} +} diff --git a/man/read_waterdata_latest_continuous.Rd b/man/read_waterdata_latest_continuous.Rd index 5af72c3f..dbeea295 100644 --- a/man/read_waterdata_latest_continuous.Rd +++ b/man/read_waterdata_latest_continuous.Rd @@ -17,6 +17,8 @@ read_waterdata_latest_continuous( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments(service = + "latest-continuous"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -90,6 +92,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids.} + \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} @@ -173,6 +179,17 @@ multi_site2 <- read_waterdata_latest_continuous(monitoring_location_id = c("USG parameter_code = c("00060", "72019"), last_modified = "P7D") +dane <- read_waterdata_latest_continuous( + monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County" + ), + parameter_code = "00060", + time = "P1D") + } \dontshow{\}) # examplesIf} } +\seealso{ +\code{\link[=make_monitoring_location_arguments]{make_monitoring_location_arguments()}} +} diff --git a/man/read_waterdata_latest_daily.Rd b/man/read_waterdata_latest_daily.Rd index 3989eb39..a535c5ba 100644 --- a/man/read_waterdata_latest_daily.Rd +++ b/man/read_waterdata_latest_daily.Rd @@ -18,6 +18,8 @@ read_waterdata_latest_daily( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments(service = + "latest-daily"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -95,6 +97,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids.} + \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} @@ -171,6 +177,17 @@ multi_site <- read_waterdata_latest_daily(monitoring_location_id = c("USGS-0149 "USGS-01645000"), parameter_code = c("00060", "00010")) +dane <- read_waterdata_latest_daily( + monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County" + ), + parameter_code = "00060", + time = "P7D") + } \dontshow{\}) # examplesIf} } +\seealso{ +\code{\link[=make_monitoring_location_arguments]{make_monitoring_location_arguments()}} +} diff --git a/man/read_waterdata_peaks.Rd b/man/read_waterdata_peaks.Rd index 260b3654..a69bb681 100644 --- a/man/read_waterdata_peaks.Rd +++ b/man/read_waterdata_peaks.Rd @@ -22,6 +22,7 @@ read_waterdata_peaks( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments(service = "peaks"), ..., allow_incomplete_dates = FALSE, convertType = getOption("dataRetrieval.convertType"), @@ -104,6 +105,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids.} + \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} @@ -176,6 +181,13 @@ dv_data_sf <- read_waterdata_peaks( monitoring_location_id = wi_peaks$monitoring_location_id[1], parameter_code = "00060") +dane <- read_waterdata_peaks( + monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County" + ), + parameter_code = "00060") + incomplete_dates_not_allowed <- read_waterdata_peaks( monitoring_location_id = "USGS-06334330", parameter_code = "00060") @@ -189,3 +201,6 @@ incomplete_dates_allowed$time } \dontshow{\}) # examplesIf} } +\seealso{ +\code{\link[=make_monitoring_location_arguments]{make_monitoring_location_arguments()}} +} From 042903851cba16c770171ce8dc8d237bb629e475 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 15:38:05 -0500 Subject: [PATCH 05/17] pkgdown --- _pkgdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index dacf3d73..d67dbae8 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -79,7 +79,7 @@ reference: - read_waterdata_monitoring_location - read_waterdata_latest_continuous - read_waterdata_latest_daily - - read_waterdata_latest_field + - read_waterdata_latest_field_measurements - read_waterdata_field_measurements - read_waterdata_parameter_codes - read_waterdata_metadata From 600ef57f8f727399201a2670d6513c56460ad80c Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 16:11:21 -0500 Subject: [PATCH 06/17] adding q --- R/read_waterdata_monitoring_location.R | 20 ++++++++++++++++++ _pkgdown.yml | 1 + man/read_waterdata_monitoring_location.Rd | 25 +++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/R/read_waterdata_monitoring_location.R b/R/read_waterdata_monitoring_location.R index 8561f98a..98359183 100644 --- a/R/read_waterdata_monitoring_location.R +++ b/R/read_waterdata_monitoring_location.R @@ -44,10 +44,25 @@ #' @param well_constructed_depth `r get_ogc_params("monitoring-locations")$well_constructed_depth` #' @param hole_constructed_depth `r get_ogc_params("monitoring-locations")$hole_constructed_depth` #' @param depth_source_code `r get_ogc_params("monitoring-locations")$depth_source_code` +#' @param revision_note `r get_ogc_params("monitoring-locations")$revision_note` +#' @param revision_created `r get_ogc_params("monitoring-locations")$revision_created` +#' @param revision_modified `r get_ogc_params("monitoring-locations")$revision_modified` #' @param properties A vector of requested columns to be returned from the query. #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("monitoring-locations", "monitoring_location_id")`. #' The default (`NA`) will return all columns of the data. +#' @param q Full-text search across the most relevant text fields for this collection +#' (e.g. site name, identifier, number, state, county, and site type). +#' Matching rules: +#' - Case-insensitive, with prefix matching (e.g. poud matches POUDRE). +#' - Words separated by spaces are AND'd together (all must match). +#' - Terms separated by commas are OR'd together (any may match). +#' - Common abbreviations are expanded, so river also matches sites stored as RV (and vice versa). +#' Examples are: +#' q=poudre - sites whose name/identifier starts with or contains poudre +#' q=colorado river - sites matching both colorado and river/rv +#' q=poudre,cache creek - sites matching poudre OR (cache AND creek/ck) +#' #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @examplesIf is_dataRetrieval_user() @@ -80,6 +95,7 @@ #' bbox_vals = c(-94.00, 35.0, -93.5, 35.5) #' multi_site <- read_waterdata_monitoring_location(bbox = bbox_vals) #' +#' poudre <- read_waterdata_monitoring_location(q = "poudre") #' #' } read_waterdata_monitoring_location <- function( @@ -123,7 +139,11 @@ read_waterdata_monitoring_location <- function( well_constructed_depth = NA_character_, hole_constructed_depth = NA_character_, depth_source_code = NA_character_, + revision_note = NA_character_, + revision_created = NA_character_, + revision_modified = NA_character_, properties = NA_character_, + q = NA_character_, bbox = NA, skipGeometry = NA, ..., diff --git a/_pkgdown.yml b/_pkgdown.yml index d67dbae8..a95d78a1 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -91,6 +91,7 @@ reference: - read_waterdata_peaks - summarize_waterdata_samples - check_waterdata_sample_params + - make_monitoring_location_arguments - title: National Water Information System (NWIS) desc: Functions to retrieve (USGS) NWIS data. These will be slowly phased out and replaced with the read_waterdata family of functions. contents: diff --git a/man/read_waterdata_monitoring_location.Rd b/man/read_waterdata_monitoring_location.Rd index be42815c..e9c20e68 100644 --- a/man/read_waterdata_monitoring_location.Rd +++ b/man/read_waterdata_monitoring_location.Rd @@ -45,7 +45,11 @@ read_waterdata_monitoring_location( well_constructed_depth = NA_character_, hole_constructed_depth = NA_character_, depth_source_code = NA_character_, + revision_note = NA_character_, + revision_created = NA_character_, + revision_modified = NA_character_, properties = NA_character_, + q = NA_character_, bbox = NA, skipGeometry = NA, ..., @@ -138,11 +142,31 @@ Multiple monitoring_location_ids can be requested as a character vector.} \item{depth_source_code}{A code indicating the source of water-level data.} +\item{revision_note}{Approved water data are considered published record, but on occasion changes or deletions (revisions) must be made to data after they are approved. Data revisions are rare because of USGS quality assurance practices, including documentation of all data before they are officially approved. This field contains text explanations for data revisions at this monitoring location. Changes to data also are indicated with revision qualifier codes alongside the data. Text explanations before 2017 are not necessarily available online, but can be requested.} + +\item{revision_created}{The date a revision statement was created.} + +\item{revision_modified}{The most recent date a revision statement was modified.} + \item{properties}{A vector of requested columns to be returned from the query. Available options are: geometry, monitoring_location_id, agency_code, agency_name, monitoring_location_number, monitoring_location_name, district_code, country_code, country_name, state_code, state_name, county_code, county_name, minor_civil_division_code, site_type_code, site_type, hydrologic_unit_code, basin_code, altitude, altitude_accuracy, altitude_method_code, altitude_method_name, vertical_datum, vertical_datum_name, horizontal_positional_accuracy_code, horizontal_positional_accuracy, horizontal_position_method_code, horizontal_position_method_name, original_horizontal_datum, original_horizontal_datum_name, drainage_area, contributing_drainage_area, time_zone_abbreviation, uses_daylight_savings, construction_date, aquifer_code, national_aquifer_code, aquifer_type_code, well_constructed_depth, hole_constructed_depth, depth_source_code, revision_note, revision_created, revision_modified. The default (\code{NA}) will return all columns of the data.} +\item{q}{Full-text search across the most relevant text fields for this collection +(e.g. site name, identifier, number, state, county, and site type). +Matching rules: +\itemize{ +\item Case-insensitive, with prefix matching (e.g. poud matches POUDRE). +\item Words separated by spaces are AND'd together (all must match). +\item Terms separated by commas are OR'd together (any may match). +\item Common abbreviations are expanded, so river also matches sites stored as RV (and vice versa). +Examples are: +q=poudre - sites whose name/identifier starts with or contains poudre +q=colorado river - sites matching both colorado and river/rv +q=poudre,cache creek - sites matching poudre OR (cache AND creek/ck) +}} + \item{bbox}{Only features that have a geometry that intersects the bounding box are selected.The bounding box is provided as four or six numbers, depending on whether the coordinate reference system includes a vertical axis (height or @@ -215,6 +239,7 @@ site_info_no_sf <- read_waterdata_monitoring_location( bbox_vals = c(-94.00, 35.0, -93.5, 35.5) multi_site <- read_waterdata_monitoring_location(bbox = bbox_vals) +poudre <- read_waterdata_monitoring_location(q = "poudre") } \dontshow{\}) # examplesIf} From 717d7ea515e4ce2ab9fd8826226bdbd5bfcdf8d7 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 16:26:43 -0500 Subject: [PATCH 07/17] bring these back someday --- tests/testthat/tests_userFriendly_fxns.R | 77 ++++++++++++------------ 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/tests/testthat/tests_userFriendly_fxns.R b/tests/testthat/tests_userFriendly_fxns.R index b59e8fbd..23215ed9 100644 --- a/tests/testthat/tests_userFriendly_fxns.R +++ b/tests/testthat/tests_userFriendly_fxns.R @@ -272,45 +272,44 @@ test_that("read_waterdata_daily", { # "ICE, REGULATED, UNKNOWNREGULATION")) }) -test_that("WQP qw tests", { - testthat::skip_on_cran() - skip_on_ci() - # nameToUse <- "Specific conductance" - # pcodeToUse <- "00095" - # - # INFO_WQP <- readWQPqw( - # "USGS-04024315", - # pcodeToUse, - # startDate = "", - # endDate = "", - # legacy = FALSE - # ) - # expect_is(INFO_WQP$Activity_StartDateTime, "POSIXct") - # - # INFO2 <- readWQPqw( - # "WIDNR_WQX-10032762", - # nameToUse, - # startDate = "", - # endDate = "", - # legacy = FALSE - # ) - # expect_is(INFO2$Activity_StartDateTime, "POSIXct") - # - # df <- readWQPqw("USGS-04193500", parameterCd = "00665", legacy = FALSE) - # expect_true(nrow(df) > 0) - # - # df2 <- readWQPqw("USGS-05427718", parameterCd = "all") - # expect_true(nrow(df2) > 0) - # - # #Empty legacy: - # df3 <- readWQPqw( - # siteNumbers = "USGS-385032115220501", - # parameterCd = "all", - # legacy = TRUE - # ) - # expect_true(nrow(df3) == 0) -}) - +# test_that("WQP qw tests", { +# testthat::skip_on_cran() +# skip_on_ci() +# nameToUse <- "Specific conductance" +# pcodeToUse <- "00095" +# +# INFO_WQP <- readWQPqw( +# "USGS-04024315", +# pcodeToUse, +# startDate = "", +# endDate = "", +# legacy = FALSE +# ) +# expect_is(INFO_WQP$Activity_StartDateTime, "POSIXct") +# +# INFO2 <- readWQPqw( +# "WIDNR_WQX-10032762", +# nameToUse, +# startDate = "", +# endDate = "", +# legacy = FALSE +# ) +# expect_is(INFO2$Activity_StartDateTime, "POSIXct") +# +# df <- readWQPqw("USGS-04193500", parameterCd = "00665", legacy = FALSE) +# expect_true(nrow(df) > 0) +# +# df2 <- readWQPqw("USGS-05427718", parameterCd = "all") +# expect_true(nrow(df2) > 0) +# +# #Empty legacy: +# df3 <- readWQPqw( +# siteNumbers = "USGS-385032115220501", +# parameterCd = "all", +# legacy = TRUE +# ) +# expect_true(nrow(df3) == 0) +# }) context("state tests") test_that("state county tests", { From c0577a1296cb76f45af046a90fcd431f030994bf Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Wed, 8 Jul 2026 16:50:14 -0500 Subject: [PATCH 08/17] update docs --- R/check_non_returned.R | 11 +++++++-- R/read_waterdata_continuous.R | 3 ++- R/read_waterdata_daily.R | 3 ++- R/read_waterdata_field_measurements.R | 3 ++- R/read_waterdata_latest_continuous.R | 3 ++- R/read_waterdata_latest_daily.R | 3 ++- R/read_waterdata_latest_field.R | 24 ++++++++++++++++++- R/read_waterdata_peaks.R | 3 ++- man/make_monitoring_location_arguments.Rd | 11 ++++++--- man/read_waterdata_continuous.Rd | 3 ++- man/read_waterdata_daily.Rd | 3 ++- man/read_waterdata_field_measurements.Rd | 3 ++- man/read_waterdata_latest_continuous.Rd | 3 ++- man/read_waterdata_latest_daily.Rd | 3 ++- ...ead_waterdata_latest_field_measurements.Rd | 19 ++++++++++++++- man/read_waterdata_peaks.Rd | 3 ++- 16 files changed, 82 insertions(+), 19 deletions(-) diff --git a/R/check_non_returned.R b/R/check_non_returned.R index 32e4c089..cd41f85c 100644 --- a/R/check_non_returned.R +++ b/R/check_non_returned.R @@ -1,4 +1,11 @@ -#' Check for arguments that can be queried but not returned +#' Get Monitoring Location Arguments +#' +#' Many read_waterdata functions have a long list of arguments that can be used +#' to find sites that have data. Users can use this function to create a list +#' of possible arguments that can be used as input to the `monitoring_location_arguments` +#' argument (found in many of the read_waterdata functions). This function +#' also is used to check that user supplied available parameters to their queries +#' when using the `monitoring_location_arguments` argument. #' #' @param service Endpoint to check arguments against. Possible values are #' "daily", "latest-continuous", "field-measurements", "latest-daily", @@ -45,7 +52,7 @@ #' @param data_gap_interval `r check_OGC_requests(endpoint = "daily", type = "queryables")$properties$data_gap_interval$description` #' @param \dots Not used. Used to make sure the user isn't passing in arguments that aren't available. #' @param check_arguments Logical. Used to decide if the arguments passed in are available or not. The -#' default is `FALSE`. Using `TRUE` will make two calls to the API, so if you are concerted +#' default is `FALSE`. Using `TRUE` will make two calls to the API, so if you are concerned #' with minimizing API calls, keep this value as `FALSE`. If you are concerned with #' making sure your calls are accepted by the service, set to `TRUE`. #' @export diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index 842aa118..ba9aefaa 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -33,7 +33,8 @@ #' The default (`NA`) will return all columns of the data. #' @param monitoring_location_arguments A list of arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. +#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "continuous")` +#' to get a list of all possible arguments available in this list. #' @seealso [make_monitoring_location_arguments()] #' @inheritParams check_arguments_non_api #' @inheritParams check_arguments_api diff --git a/R/read_waterdata_daily.R b/R/read_waterdata_daily.R index 6d918268..2e9dde69 100644 --- a/R/read_waterdata_daily.R +++ b/R/read_waterdata_daily.R @@ -27,7 +27,8 @@ #' The default (`NA`) will return all columns of the data. #' @param monitoring_location_arguments A list of arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. +#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "daily")` +#' to get a list of all possible arguments available in this list. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/R/read_waterdata_field_measurements.R b/R/read_waterdata_field_measurements.R index 99a45863..8db1a9f3 100644 --- a/R/read_waterdata_field_measurements.R +++ b/R/read_waterdata_field_measurements.R @@ -39,7 +39,8 @@ #' The default (`NA`) will return all columns of the data. #' @param monitoring_location_arguments A list of arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. +#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "field-measurements")` +#' to get a list of all possible arguments available in this list. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/R/read_waterdata_latest_continuous.R b/R/read_waterdata_latest_continuous.R index f3575dc5..2678cac1 100644 --- a/R/read_waterdata_latest_continuous.R +++ b/R/read_waterdata_latest_continuous.R @@ -25,7 +25,8 @@ #' The default (`NA`) will return all columns of the data. #' @param monitoring_location_arguments A list of arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. +#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-continuous")` +#' to get a list of all possible arguments available in this list. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/R/read_waterdata_latest_daily.R b/R/read_waterdata_latest_daily.R index 6c67904b..f27fbe6e 100644 --- a/R/read_waterdata_latest_daily.R +++ b/R/read_waterdata_latest_daily.R @@ -27,7 +27,8 @@ #' The default (`NA`) will return all columns of the data. #' @param monitoring_location_arguments A list of arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. +#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-daily")` +#' to get a list of all possible arguments available in this list. #' #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api diff --git a/R/read_waterdata_latest_field.R b/R/read_waterdata_latest_field.R index f7a1dcf2..a2730056 100644 --- a/R/read_waterdata_latest_field.R +++ b/R/read_waterdata_latest_field.R @@ -1,4 +1,4 @@ -#' Get latest USGS field measurement data +#' Get Latest USGS Field Measurement Data #' #' @description `r get_description("latest-field-measurements")` #' @@ -25,9 +25,14 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("latest-field-measurements", "latest_field_id")`. #' The default (`NA`) will return all columns of the data. +#' @param monitoring_location_arguments A list of arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-field-measurements")` +#' to get a list of all possible arguments available in this list. #' #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api +#' @seealso [make_monitoring_location_arguments()] #' @inherit read_waterdata_continuous details #' #' @examplesIf is_dataRetrieval_user() @@ -48,6 +53,13 @@ #' multi_site <- read_waterdata_latest_field_measurements(monitoring_location_id = c("USGS-01435000", #' "USGS-14202650")) #' +#' dane <- read_waterdata_latest_field_measurements( +#' monitoring_location_arguments = list( +#' state_name = "Wisconsin", +#' county_name = "Dane County" +#' ), +#' time = "P30D") +#' #' } read_waterdata_latest_field_measurements <- function( monitoring_location_id = NA_character_, @@ -63,6 +75,9 @@ read_waterdata_latest_field_measurements <- function( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments( + service = "latest-field-measurements" + ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -75,6 +90,13 @@ read_waterdata_latest_field_measurements <- function( rlang::check_dots_empty() args <- mget(names(formals())) + + args <- cleanup_arguments( + args = args, + monitoring_location_arguments = monitoring_location_arguments, + service = service + ) + return_list <- get_ogc_data(args, output_id, service) return(return_list) diff --git a/R/read_waterdata_peaks.R b/R/read_waterdata_peaks.R index d49cf9f9..d3d0ccf3 100644 --- a/R/read_waterdata_peaks.R +++ b/R/read_waterdata_peaks.R @@ -38,7 +38,8 @@ #' month stored on January 1. Default is `FALSE`. #' @param monitoring_location_arguments A list of arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. +#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "peaks")` +#' to get a list of all possible arguments available in this list. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/man/make_monitoring_location_arguments.Rd b/man/make_monitoring_location_arguments.Rd index ebe061f2..af08765e 100644 --- a/man/make_monitoring_location_arguments.Rd +++ b/man/make_monitoring_location_arguments.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/check_non_returned.R \name{make_monitoring_location_arguments} \alias{make_monitoring_location_arguments} -\title{Check for arguments that can be queried but not returned} +\title{Get Monitoring Location Arguments} \usage{ make_monitoring_location_arguments( service = c("daily"), @@ -138,12 +138,17 @@ make_monitoring_location_arguments( \item{\dots}{Not used. Used to make sure the user isn't passing in arguments that aren't available.} \item{check_arguments}{Logical. Used to decide if the arguments passed in are available or not. The -default is \code{FALSE}. Using \code{TRUE} will make two calls to the API, so if you are concerted +default is \code{FALSE}. Using \code{TRUE} will make two calls to the API, so if you are concerned with minimizing API calls, keep this value as \code{FALSE}. If you are concerned with making sure your calls are accepted by the service, set to \code{TRUE}.} } \description{ -Check for arguments that can be queried but not returned +Many read_waterdata functions have a long list of arguments that can be used +to find sites that have data. Users can use this function to create a list +of possible arguments that can be used as input to the \code{monitoring_location_arguments} +argument (found in many of the read_waterdata functions). This function +also is used to check that user supplied available parameters to their queries +when using the \code{monitoring_location_arguments} argument. } \examples{ diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index 83b184ea..85d774bb 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -94,7 +94,8 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} \item{monitoring_location_arguments}{A list of arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids.} +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "continuous")} +to get a list of all possible arguments available in this list.} \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} diff --git a/man/read_waterdata_daily.Rd b/man/read_waterdata_daily.Rd index 051fe248..c28c775c 100644 --- a/man/read_waterdata_daily.Rd +++ b/man/read_waterdata_daily.Rd @@ -98,7 +98,8 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} \item{monitoring_location_arguments}{A list of arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids.} +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "daily")} +to get a list of all possible arguments available in this list.} \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} diff --git a/man/read_waterdata_field_measurements.Rd b/man/read_waterdata_field_measurements.Rd index e07b9a99..9beb5099 100644 --- a/man/read_waterdata_field_measurements.Rd +++ b/man/read_waterdata_field_measurements.Rd @@ -122,7 +122,8 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} \item{monitoring_location_arguments}{A list of arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids.} +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "field-measurements")} +to get a list of all possible arguments available in this list.} \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} diff --git a/man/read_waterdata_latest_continuous.Rd b/man/read_waterdata_latest_continuous.Rd index dbeea295..9de7f1a6 100644 --- a/man/read_waterdata_latest_continuous.Rd +++ b/man/read_waterdata_latest_continuous.Rd @@ -94,7 +94,8 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} \item{monitoring_location_arguments}{A list of arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids.} +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-continuous")} +to get a list of all possible arguments available in this list.} \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} diff --git a/man/read_waterdata_latest_daily.Rd b/man/read_waterdata_latest_daily.Rd index a535c5ba..0c443fb5 100644 --- a/man/read_waterdata_latest_daily.Rd +++ b/man/read_waterdata_latest_daily.Rd @@ -99,7 +99,8 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} \item{monitoring_location_arguments}{A list of arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids.} +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-daily")} +to get a list of all possible arguments available in this list.} \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} diff --git a/man/read_waterdata_latest_field_measurements.Rd b/man/read_waterdata_latest_field_measurements.Rd index 3303acfe..c0cdd079 100644 --- a/man/read_waterdata_latest_field_measurements.Rd +++ b/man/read_waterdata_latest_field_measurements.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/read_waterdata_latest_field.R \name{read_waterdata_latest_field_measurements} \alias{read_waterdata_latest_field_measurements} -\title{Get latest USGS field measurement data} +\title{Get Latest USGS Field Measurement Data} \usage{ read_waterdata_latest_field_measurements( monitoring_location_id = NA_character_, @@ -18,6 +18,8 @@ read_waterdata_latest_field_measurements( skipGeometry = NA, time = NA_character_, bbox = NA, + monitoring_location_arguments = make_monitoring_location_arguments(service = + "latest-field-measurements"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -91,6 +93,11 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-field-measurements")} +to get a list of all possible arguments available in this list.} + \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} @@ -159,6 +166,16 @@ field_data <- read_waterdata_latest_field_measurements(monitoring_location_id = multi_site <- read_waterdata_latest_field_measurements(monitoring_location_id = c("USGS-01435000", "USGS-14202650")) +dane <- read_waterdata_latest_field_measurements( + monitoring_location_arguments = list( + state_name = "Wisconsin", + county_name = "Dane County" + ), + time = "P30D") + } \dontshow{\}) # examplesIf} } +\seealso{ +\code{\link[=make_monitoring_location_arguments]{make_monitoring_location_arguments()}} +} diff --git a/man/read_waterdata_peaks.Rd b/man/read_waterdata_peaks.Rd index a69bb681..20258e91 100644 --- a/man/read_waterdata_peaks.Rd +++ b/man/read_waterdata_peaks.Rd @@ -107,7 +107,8 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} \item{monitoring_location_arguments}{A list of arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids.} +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "peaks")} +to get a list of all possible arguments available in this list.} \item{...}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} From fd5292178cefad514025d0bc02e2be6dae715e58 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 9 Jul 2026 10:47:15 -0500 Subject: [PATCH 09/17] Change to dots --- R/get_ogc_data.R | 5 +---- ....R => make_monitoring_location_arguments.R} | 4 ++-- R/read_waterdata_channel.R | 2 ++ R/read_waterdata_combined_meta.R | 2 ++ R/read_waterdata_continuous.R | 2 ++ R/read_waterdata_daily.R | 18 +++++++----------- R/read_waterdata_field_measurements.R | 2 ++ R/read_waterdata_field_meta.R | 2 ++ R/read_waterdata_latest_continuous.R | 2 ++ R/read_waterdata_latest_daily.R | 3 ++- R/read_waterdata_peaks.R | 2 ++ R/read_waterdata_ts_meta.R | 2 ++ man/check_arguments_non_api.Rd | 6 +----- man/make_monitoring_location_arguments.Rd | 4 ++-- man/read_ngwmn_lithology.Rd | 3 --- man/read_ngwmn_providers.Rd | 3 --- man/read_ngwmn_sites.Rd | 3 --- man/read_ngwmn_water_level.Rd | 3 --- man/read_ngwmn_well_construction.Rd | 3 --- man/read_waterdata_channel.Rd | 2 +- man/read_waterdata_combined_meta.Rd | 2 +- man/read_waterdata_continuous.Rd | 2 +- man/read_waterdata_daily.Rd | 15 +++++---------- man/read_waterdata_field_measurements.Rd | 2 +- man/read_waterdata_field_meta.Rd | 2 +- man/read_waterdata_latest_continuous.Rd | 2 +- man/read_waterdata_latest_daily.Rd | 2 +- ...read_waterdata_latest_field_measurements.Rd | 3 --- man/read_waterdata_monitoring_location.Rd | 3 --- man/read_waterdata_peaks.Rd | 2 +- man/read_waterdata_ts_meta.Rd | 2 +- 31 files changed, 45 insertions(+), 65 deletions(-) rename R/{check_non_returned.R => make_monitoring_location_arguments.R} (99%) diff --git a/R/get_ogc_data.R b/R/get_ogc_data.R index 4b6952b4..87be4141 100644 --- a/R/get_ogc_data.R +++ b/R/get_ogc_data.R @@ -218,16 +218,13 @@ switch_properties_id <- function(properties, id) { #' the default for time series functions is #' `r getOption("dataRetrieval.site_chunk_size_data")`. #' Setting to `NA` will eliminate site chunking, giving users full control. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. #' @keywords internal check_arguments_non_api <- function( convertType, no_paging, limit, attach_request, - chunk_size, - ... + chunk_size ) { check_logical(convertType, "convertType") check_logical(no_paging, "no_paging") diff --git a/R/check_non_returned.R b/R/make_monitoring_location_arguments.R similarity index 99% rename from R/check_non_returned.R rename to R/make_monitoring_location_arguments.R index cd41f85c..769163c8 100644 --- a/R/check_non_returned.R +++ b/R/make_monitoring_location_arguments.R @@ -62,7 +62,7 @@ #' make_monitoring_location_arguments(service = "field-measurements", #' state_name = c("Ohio", "Wisconsin")) make_monitoring_location_arguments <- function( - service = c("daily"), + service = "daily", agency_code = NA_character_, agency_name = NA_character_, monitoring_location_number = NA_character_, @@ -165,7 +165,7 @@ cleanup_arguments <- function(args, monitoring_location_arguments, service) { ) args[["monitoring_location_arguments"]] <- NULL - + args[["..."]] <- NULL args <- c(args, query_args) return(args) diff --git a/R/read_waterdata_channel.R b/R/read_waterdata_channel.R index 74e92840..74fbdb9d 100644 --- a/R/read_waterdata_channel.R +++ b/R/read_waterdata_channel.R @@ -34,6 +34,8 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("channel-measurements", "channel_measurements_id")`. #' The default (`NA`) will return all columns of the data. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' diff --git a/R/read_waterdata_combined_meta.R b/R/read_waterdata_combined_meta.R index de173e1d..b84e76b8 100644 --- a/R/read_waterdata_combined_meta.R +++ b/R/read_waterdata_combined_meta.R @@ -82,6 +82,8 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("combined-metadata", "field_measurement_id")`. #' The default (`NA`) will return all columns of the data. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @inherit read_waterdata_continuous details diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index ba9aefaa..8a0a292c 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -35,6 +35,8 @@ #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "continuous")` #' to get a list of all possible arguments available in this list. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @seealso [make_monitoring_location_arguments()] #' @inheritParams check_arguments_non_api #' @inheritParams check_arguments_api diff --git a/R/read_waterdata_daily.R b/R/read_waterdata_daily.R index 2e9dde69..88b48a44 100644 --- a/R/read_waterdata_daily.R +++ b/R/read_waterdata_daily.R @@ -25,10 +25,10 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("daily", "daily_id")`. #' The default (`NA`) will return all columns of the data. -#' @param monitoring_location_arguments A list of arguments that can be queried, +#' @param \dots Arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "daily")` -#' to get a list of all possible arguments available in this list. +#' monitoring_location_ids. See `make_monitoring_location_arguments()` +#' to get a list of all possible arguments available. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] @@ -77,9 +77,8 @@ #' parameter_code = "00060", #' time = c("2021-01-01", "2022-01-01")) #' -#' dv_dane <- read_waterdata_daily(monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County"), +#' dv_dane <- read_waterdata_daily(state_name = "Wisconsin", +#' county_name = "Dane County", #' parameter_code = "00060", #' time = "P7D") #' @@ -98,9 +97,6 @@ read_waterdata_daily <- function( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments( - service = "daily" - ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -110,12 +106,12 @@ read_waterdata_daily <- function( ) { service <- "daily" output_id <- "daily_id" - rlang::check_dots_empty() + args <- mget(names(formals())) args <- cleanup_arguments( args = args, - monitoring_location_arguments = monitoring_location_arguments, + monitoring_location_arguments = list(...), service = service ) diff --git a/R/read_waterdata_field_measurements.R b/R/read_waterdata_field_measurements.R index 8db1a9f3..a9d8b1bd 100644 --- a/R/read_waterdata_field_measurements.R +++ b/R/read_waterdata_field_measurements.R @@ -41,6 +41,8 @@ #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "field-measurements")` #' to get a list of all possible arguments available in this list. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/R/read_waterdata_field_meta.R b/R/read_waterdata_field_meta.R index b45df015..b499c5fb 100644 --- a/R/read_waterdata_field_meta.R +++ b/R/read_waterdata_field_meta.R @@ -24,6 +24,8 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("field-measurements-metadata", "field_measurement_id")`. #' The default (`NA`) will return all columns of the data. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api diff --git a/R/read_waterdata_latest_continuous.R b/R/read_waterdata_latest_continuous.R index 2678cac1..ca3499b9 100644 --- a/R/read_waterdata_latest_continuous.R +++ b/R/read_waterdata_latest_continuous.R @@ -27,6 +27,8 @@ #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-continuous")` #' to get a list of all possible arguments available in this list. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/R/read_waterdata_latest_daily.R b/R/read_waterdata_latest_daily.R index f27fbe6e..b1236d8b 100644 --- a/R/read_waterdata_latest_daily.R +++ b/R/read_waterdata_latest_daily.R @@ -29,7 +29,8 @@ #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-daily")` #' to get a list of all possible arguments available in this list. -#' +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/R/read_waterdata_peaks.R b/R/read_waterdata_peaks.R index d3d0ccf3..6caef0e0 100644 --- a/R/read_waterdata_peaks.R +++ b/R/read_waterdata_peaks.R @@ -40,6 +40,8 @@ #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "peaks")` #' to get a list of all possible arguments available in this list. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/R/read_waterdata_ts_meta.R b/R/read_waterdata_ts_meta.R index b3f869de..0b06a704 100644 --- a/R/read_waterdata_ts_meta.R +++ b/R/read_waterdata_ts_meta.R @@ -45,6 +45,8 @@ #' `r dataRetrieval:::get_properties_for_docs("time-series-metadata", "time_series_id")`. #' The default (`NA`) will return all columns of the data. #' @param time_series_id `r get_ogc_params("time-series-metadata")$id` +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' diff --git a/man/check_arguments_non_api.Rd b/man/check_arguments_non_api.Rd index 193ab821..bf59ebb9 100644 --- a/man/check_arguments_non_api.Rd +++ b/man/check_arguments_non_api.Rd @@ -9,8 +9,7 @@ check_arguments_non_api( no_paging, limit, attach_request, - chunk_size, - ... + chunk_size ) } \arguments{ @@ -40,9 +39,6 @@ is 250, while the default for time series functions is 10. Setting to \code{NA} will eliminate site chunking, giving users full control.} - -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} } \description{ Function to check types and create parameter descriptions. diff --git a/man/make_monitoring_location_arguments.Rd b/man/make_monitoring_location_arguments.Rd index af08765e..802efdda 100644 --- a/man/make_monitoring_location_arguments.Rd +++ b/man/make_monitoring_location_arguments.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/check_non_returned.R +% Please edit documentation in R/make_monitoring_location_arguments.R \name{make_monitoring_location_arguments} \alias{make_monitoring_location_arguments} \title{Get Monitoring Location Arguments} \usage{ make_monitoring_location_arguments( - service = c("daily"), + service = "daily", agency_code = NA_character_, agency_name = NA_character_, monitoring_location_number = NA_character_, diff --git a/man/read_ngwmn_lithology.Rd b/man/read_ngwmn_lithology.Rd index b50588ba..8b38cf12 100644 --- a/man/read_ngwmn_lithology.Rd +++ b/man/read_ngwmn_lithology.Rd @@ -26,9 +26,6 @@ Available options are: agency_code, monitoring_location_number, monitoring_location_id, monitoring_location_obs_number, lithology_id, lithology_description, lithology_controlled_concept, lithology_depth_from, lithology_depth_to, lithology_depth_to_unit, lithology_depth_from_unit. The default (\code{NA}) will return all columns of the data.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} - \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_providers.Rd b/man/read_ngwmn_providers.Rd index 82bd71d7..6517f40a 100644 --- a/man/read_ngwmn_providers.Rd +++ b/man/read_ngwmn_providers.Rd @@ -29,9 +29,6 @@ Available options are: agency_name, agency_code, organization_type, state, link. The default (\code{NA}) will return all columns of the data.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} - \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_sites.Rd b/man/read_ngwmn_sites.Rd index f291585e..fc5191c8 100644 --- a/man/read_ngwmn_sites.Rd +++ b/man/read_ngwmn_sites.Rd @@ -108,9 +108,6 @@ The default (\code{NA}) will return all columns of the data.} each feature. The returning object will be a data frame with no spatial information.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} - \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_water_level.Rd b/man/read_ngwmn_water_level.Rd index 949c0751..16de6b49 100644 --- a/man/read_ngwmn_water_level.Rd +++ b/man/read_ngwmn_water_level.Rd @@ -65,9 +65,6 @@ Examples: Only features that have a \code{sample_time} that intersects the value of datetime are selected. If a feature has multiple temporal properties, it is the decision of the server whether only a single temporal property is used to determine the extent or all relevant temporal properties.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} - \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_well_construction.Rd b/man/read_ngwmn_well_construction.Rd index 352e166e..76544655 100644 --- a/man/read_ngwmn_well_construction.Rd +++ b/man/read_ngwmn_well_construction.Rd @@ -29,9 +29,6 @@ Available options are: agency_code, monitoring_location_number, monitoring_location_id, monitoring_location_obs_number, type, depth_from, depth_to, depth_from_unit, depth_to_unit, material, diameter, diameter_unit, hole_size, hole_size_unit. The default (\code{NA}) will return all columns of the data.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} - \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_waterdata_channel.Rd b/man/read_waterdata_channel.Rd index e9bee3b9..9f7e0c0e 100644 --- a/man/read_waterdata_channel.Rd +++ b/man/read_waterdata_channel.Rd @@ -132,7 +132,7 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. diff --git a/man/read_waterdata_combined_meta.Rd b/man/read_waterdata_combined_meta.Rd index f5147793..8f3f0100 100644 --- a/man/read_waterdata_combined_meta.Rd +++ b/man/read_waterdata_combined_meta.Rd @@ -252,7 +252,7 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index 85d774bb..b49c1145 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -97,7 +97,7 @@ but are not returned. These are used as alternatives to specifying specific monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "continuous")} to get a list of all possible arguments available in this list.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. diff --git a/man/read_waterdata_daily.Rd b/man/read_waterdata_daily.Rd index c28c775c..5ef5297a 100644 --- a/man/read_waterdata_daily.Rd +++ b/man/read_waterdata_daily.Rd @@ -18,7 +18,6 @@ read_waterdata_daily( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments(service = "daily"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -96,13 +95,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{monitoring_location_arguments}{A list of arguments that can be queried, +\item{\dots}{Arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "daily")} -to get a list of all possible arguments available in this list.} - -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} +monitoring_location_ids. See \code{make_monitoring_location_arguments()} +to get a list of all possible arguments available.} \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string @@ -194,9 +190,8 @@ dv_data_no_request <- read_waterdata_daily(monitoring_location_id = site, parameter_code = "00060", time = c("2021-01-01", "2022-01-01")) -dv_dane <- read_waterdata_daily(monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County"), +dv_dane <- read_waterdata_daily(state_name = "Wisconsin", + county_name = "Dane County", parameter_code = "00060", time = "P7D") diff --git a/man/read_waterdata_field_measurements.Rd b/man/read_waterdata_field_measurements.Rd index 9beb5099..57462756 100644 --- a/man/read_waterdata_field_measurements.Rd +++ b/man/read_waterdata_field_measurements.Rd @@ -125,7 +125,7 @@ but are not returned. These are used as alternatives to specifying specific monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "field-measurements")} to get a list of all possible arguments available in this list.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. diff --git a/man/read_waterdata_field_meta.Rd b/man/read_waterdata_field_meta.Rd index 30bec39a..9047ae65 100644 --- a/man/read_waterdata_field_meta.Rd +++ b/man/read_waterdata_field_meta.Rd @@ -104,7 +104,7 @@ limit is 50,000. It may be beneficial to set this number lower if your internet connection is spotty. The default (\code{NA}) will set the limit to the maximum allowable limit for the service.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. diff --git a/man/read_waterdata_latest_continuous.Rd b/man/read_waterdata_latest_continuous.Rd index 9de7f1a6..1cf2db82 100644 --- a/man/read_waterdata_latest_continuous.Rd +++ b/man/read_waterdata_latest_continuous.Rd @@ -97,7 +97,7 @@ but are not returned. These are used as alternatives to specifying specific monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-continuous")} to get a list of all possible arguments available in this list.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. diff --git a/man/read_waterdata_latest_daily.Rd b/man/read_waterdata_latest_daily.Rd index 0c443fb5..c83c8b8d 100644 --- a/man/read_waterdata_latest_daily.Rd +++ b/man/read_waterdata_latest_daily.Rd @@ -102,7 +102,7 @@ but are not returned. These are used as alternatives to specifying specific monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-daily")} to get a list of all possible arguments available in this list.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{convertType}{logical, defaults to TRUE. diff --git a/man/read_waterdata_latest_field_measurements.Rd b/man/read_waterdata_latest_field_measurements.Rd index c0cdd079..b1c708cc 100644 --- a/man/read_waterdata_latest_field_measurements.Rd +++ b/man/read_waterdata_latest_field_measurements.Rd @@ -98,9 +98,6 @@ but are not returned. These are used as alternatives to specifying specific monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-field-measurements")} to get a list of all possible arguments available in this list.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} - \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_waterdata_monitoring_location.Rd b/man/read_waterdata_monitoring_location.Rd index e9c20e68..cae5751b 100644 --- a/man/read_waterdata_monitoring_location.Rd +++ b/man/read_waterdata_monitoring_location.Rd @@ -179,9 +179,6 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} each feature. The returning object will be a data frame with no spatial information. The default \code{NA} will not specify the argument in the request.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} - \item{limit}{numeric, The optional limit parameter is used to control the subset of the selected features that should be returned in each page. The maximum allowable limit is 50,000. It may be beneficial to set this number lower if your internet diff --git a/man/read_waterdata_peaks.Rd b/man/read_waterdata_peaks.Rd index 20258e91..3ef0022b 100644 --- a/man/read_waterdata_peaks.Rd +++ b/man/read_waterdata_peaks.Rd @@ -110,7 +110,7 @@ but are not returned. These are used as alternatives to specifying specific monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "peaks")} to get a list of all possible arguments available in this list.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{allow_incomplete_dates}{Specifically in the peaks data, exact peak dates diff --git a/man/read_waterdata_ts_meta.Rd b/man/read_waterdata_ts_meta.Rd index dd4c80cb..fd381a2f 100644 --- a/man/read_waterdata_ts_meta.Rd +++ b/man/read_waterdata_ts_meta.Rd @@ -145,7 +145,7 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} \item{end}{This field contains the same information as "end_utc", but in the local time of the monitoring location. It is retained for backwards compatibility, but will be removed in V1 of these APIs.} -\item{...}{Not used. Included to help differentiate official Water Data API arguments +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments from more seldom used, optional dataRetrieval-specific arguments.} \item{limit}{numeric, The optional limit parameter is used to control the subset of the From be7fa99edb58b5a55853b86e5db57e223bbf1a39 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 9 Jul 2026 10:56:33 -0500 Subject: [PATCH 10/17] dots --- R/read_waterdata_monitoring_location.R | 2 ++ man/read_waterdata_monitoring_location.Rd | 3 +++ 2 files changed, 5 insertions(+) diff --git a/R/read_waterdata_monitoring_location.R b/R/read_waterdata_monitoring_location.R index 98359183..898f891c 100644 --- a/R/read_waterdata_monitoring_location.R +++ b/R/read_waterdata_monitoring_location.R @@ -51,6 +51,8 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("monitoring-locations", "monitoring_location_id")`. #' The default (`NA`) will return all columns of the data. +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @param q Full-text search across the most relevant text fields for this collection #' (e.g. site name, identifier, number, state, county, and site type). #' Matching rules: diff --git a/man/read_waterdata_monitoring_location.Rd b/man/read_waterdata_monitoring_location.Rd index cae5751b..ee2b32f7 100644 --- a/man/read_waterdata_monitoring_location.Rd +++ b/man/read_waterdata_monitoring_location.Rd @@ -179,6 +179,9 @@ Southern-most latitude, Eastern-most longitude, Northern-most longitude).} each feature. The returning object will be a data frame with no spatial information. The default \code{NA} will not specify the argument in the request.} +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments +from more seldom used, optional dataRetrieval-specific arguments.} + \item{limit}{numeric, The optional limit parameter is used to control the subset of the selected features that should be returned in each page. The maximum allowable limit is 50,000. It may be beneficial to set this number lower if your internet From 79aec5302860b24f36a957df5e4ff951e22c2678 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 9 Jul 2026 11:09:07 -0500 Subject: [PATCH 11/17] Specific NGWMN dot --- R/read_ngwmn_lithology.R | 8 +++++--- R/read_ngwmn_providers.R | 2 ++ R/read_ngwmn_sites.R | 3 ++- R/read_ngwmn_water_level.R | 11 ++++++----- R/read_ngwmn_well_construction.R | 6 ++++-- R/read_waterdata_latest_field.R | 3 ++- man/read_ngwmn_lithology.Rd | 3 +++ man/read_ngwmn_providers.Rd | 3 +++ man/read_ngwmn_sites.Rd | 3 +++ man/read_ngwmn_water_level.Rd | 3 +++ man/read_ngwmn_well_construction.Rd | 3 +++ man/read_waterdata_latest_field_measurements.Rd | 3 +++ 12 files changed, 39 insertions(+), 12 deletions(-) diff --git a/R/read_ngwmn_lithology.R b/R/read_ngwmn_lithology.R index 032352b8..d4092fd3 100644 --- a/R/read_ngwmn_lithology.R +++ b/R/read_ngwmn_lithology.R @@ -11,6 +11,8 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("lithologyObs", base = "NGWMN")`. #' The default (`NA`) will return all columns of the data. +#' @param \dots Not used. Included to help differentiate official NGWMN API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_non_api #' #' @examplesIf is_dataRetrieval_user() @@ -38,12 +40,12 @@ read_ngwmn_lithology <- function( attach_request = getOption("dataRetrieval.attach_request") ) { service <- "lithologyObs" - + # Check for mandatory arguments: - if(all(is.na(monitoring_location_id))){ + if (all(is.na(monitoring_location_id))) { stop("monitoring_location_id is a mandatory argument.") } - + rlang::check_dots_empty() args <- mget(names(formals())) diff --git a/R/read_ngwmn_providers.R b/R/read_ngwmn_providers.R index ae322fdc..d3740e60 100644 --- a/R/read_ngwmn_providers.R +++ b/R/read_ngwmn_providers.R @@ -13,6 +13,8 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("providers", base = "NGWMN")`. #' The default (`NA`) will return all columns of the data. +#' @param \dots Not used. Included to help differentiate official NGWMN API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_non_api #' #' @examplesIf is_dataRetrieval_user() diff --git a/R/read_ngwmn_sites.R b/R/read_ngwmn_sites.R index c8eb3857..961900a4 100644 --- a/R/read_ngwmn_sites.R +++ b/R/read_ngwmn_sites.R @@ -68,7 +68,8 @@ #' depth). Coordinates are assumed to be in crs 4326. The expected format is a numeric #' vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, #' Southern-most latitude, Eastern-most longitude, Northern-most longitude). -#' +#' @param \dots Not used. Included to help differentiate official NGWMN API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_non_api #' @examplesIf is_dataRetrieval_user() #' diff --git a/R/read_ngwmn_water_level.R b/R/read_ngwmn_water_level.R index 307930e9..6bfc3778 100644 --- a/R/read_ngwmn_water_level.R +++ b/R/read_ngwmn_water_level.R @@ -24,12 +24,13 @@ #' #' @param datetime #' `r get_ogc_params("waterLevelObs", base = "NGWMN")$sample_time$description` -#' +#' #' @param properties A vector of requested columns to be returned from the query. #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("waterLevelObs", base = "NGWMN")`. #' The default (`NA`) will return all columns of the data. -#' +#' @param \dots Not used. Included to help differentiate official NGWMN API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_non_api #' #' @examplesIf is_dataRetrieval_user() @@ -68,12 +69,12 @@ read_ngwmn_water_level <- function( attach_request = getOption("dataRetrieval.attach_request") ) { service <- "waterLevelObs" - + # Check for mandatory arguments: - if(all(is.na(monitoring_location_id))){ + if (all(is.na(monitoring_location_id))) { stop("monitoring_location_id is a mandatory argument.") } - + rlang::check_dots_empty() args <- mget(names(formals())) diff --git a/R/read_ngwmn_well_construction.R b/R/read_ngwmn_well_construction.R index 6e11c586..3caa5a3a 100644 --- a/R/read_ngwmn_well_construction.R +++ b/R/read_ngwmn_well_construction.R @@ -13,6 +13,8 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("constructionObs", base = "NGWMN")`. #' The default (`NA`) will return all columns of the data. +#' @param \dots Not used. Included to help differentiate official NGWMN API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_non_api #' #' @examplesIf is_dataRetrieval_user() @@ -43,10 +45,10 @@ read_ngwmn_well_construction <- function( ) { service <- "constructionObs" # Check for mandatory arguments: - if(all(is.na(monitoring_location_id))){ + if (all(is.na(monitoring_location_id))) { stop("monitoring_location_id is a mandatory argument.") } - + rlang::check_dots_empty() args <- mget(names(formals())) diff --git a/R/read_waterdata_latest_field.R b/R/read_waterdata_latest_field.R index a2730056..7839aa47 100644 --- a/R/read_waterdata_latest_field.R +++ b/R/read_waterdata_latest_field.R @@ -29,7 +29,8 @@ #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-field-measurements")` #' to get a list of all possible arguments available in this list. -#' +#' @param \dots Not used. Included to help differentiate official Water Data API arguments +#' from more seldom used, optional dataRetrieval-specific arguments. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] diff --git a/man/read_ngwmn_lithology.Rd b/man/read_ngwmn_lithology.Rd index 8b38cf12..27b9636f 100644 --- a/man/read_ngwmn_lithology.Rd +++ b/man/read_ngwmn_lithology.Rd @@ -26,6 +26,9 @@ Available options are: agency_code, monitoring_location_number, monitoring_location_id, monitoring_location_obs_number, lithology_id, lithology_description, lithology_controlled_concept, lithology_depth_from, lithology_depth_to, lithology_depth_to_unit, lithology_depth_from_unit. The default (\code{NA}) will return all columns of the data.} +\item{\dots}{Not used. Included to help differentiate official NGWMN API arguments +from more seldom used, optional dataRetrieval-specific arguments.} + \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_providers.Rd b/man/read_ngwmn_providers.Rd index 6517f40a..6d128f88 100644 --- a/man/read_ngwmn_providers.Rd +++ b/man/read_ngwmn_providers.Rd @@ -29,6 +29,9 @@ Available options are: agency_name, agency_code, organization_type, state, link. The default (\code{NA}) will return all columns of the data.} +\item{\dots}{Not used. Included to help differentiate official NGWMN API arguments +from more seldom used, optional dataRetrieval-specific arguments.} + \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_sites.Rd b/man/read_ngwmn_sites.Rd index fc5191c8..35868f69 100644 --- a/man/read_ngwmn_sites.Rd +++ b/man/read_ngwmn_sites.Rd @@ -108,6 +108,9 @@ The default (\code{NA}) will return all columns of the data.} each feature. The returning object will be a data frame with no spatial information.} +\item{\dots}{Not used. Included to help differentiate official NGWMN API arguments +from more seldom used, optional dataRetrieval-specific arguments.} + \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_water_level.Rd b/man/read_ngwmn_water_level.Rd index 16de6b49..f0b95fe4 100644 --- a/man/read_ngwmn_water_level.Rd +++ b/man/read_ngwmn_water_level.Rd @@ -65,6 +65,9 @@ Examples: Only features that have a \code{sample_time} that intersects the value of datetime are selected. If a feature has multiple temporal properties, it is the decision of the server whether only a single temporal property is used to determine the extent or all relevant temporal properties.} +\item{\dots}{Not used. Included to help differentiate official NGWMN API arguments +from more seldom used, optional dataRetrieval-specific arguments.} + \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_ngwmn_well_construction.Rd b/man/read_ngwmn_well_construction.Rd index 76544655..907f21c8 100644 --- a/man/read_ngwmn_well_construction.Rd +++ b/man/read_ngwmn_well_construction.Rd @@ -29,6 +29,9 @@ Available options are: agency_code, monitoring_location_number, monitoring_location_id, monitoring_location_obs_number, type, depth_from, depth_to, depth_from_unit, depth_to_unit, material, diameter, diameter_unit, hole_size, hole_size_unit. The default (\code{NA}) will return all columns of the data.} +\item{\dots}{Not used. Included to help differentiate official NGWMN API arguments +from more seldom used, optional dataRetrieval-specific arguments.} + \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} diff --git a/man/read_waterdata_latest_field_measurements.Rd b/man/read_waterdata_latest_field_measurements.Rd index b1c708cc..895bd2a9 100644 --- a/man/read_waterdata_latest_field_measurements.Rd +++ b/man/read_waterdata_latest_field_measurements.Rd @@ -98,6 +98,9 @@ but are not returned. These are used as alternatives to specifying specific monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-field-measurements")} to get a list of all possible arguments available in this list.} +\item{\dots}{Not used. Included to help differentiate official Water Data API arguments +from more seldom used, optional dataRetrieval-specific arguments.} + \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string vector and reorder the returned data frame.} From 3f87265eae5e834d6b42158d2be00a141da370cc Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 9 Jul 2026 11:57:23 -0500 Subject: [PATCH 12/17] simplify to just dots --- R/read_waterdata_continuous.R | 20 +++++------------ R/read_waterdata_field_measurements.R | 20 +++++------------ R/read_waterdata_latest_continuous.R | 20 +++++------------ R/read_waterdata_latest_daily.R | 20 +++++------------ R/read_waterdata_latest_field.R | 18 ++++++--------- R/read_waterdata_peaks.R | 20 +++++------------ man/read_waterdata_continuous.Rd | 17 +++++--------- man/read_waterdata_field_measurements.Rd | 17 +++++--------- man/read_waterdata_latest_continuous.Rd | 17 +++++--------- man/read_waterdata_latest_daily.Rd | 17 +++++--------- ...ead_waterdata_latest_field_measurements.Rd | 22 +++++++++---------- man/read_waterdata_peaks.Rd | 16 +++++--------- 12 files changed, 72 insertions(+), 152 deletions(-) diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index 8a0a292c..92bfa4db 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -31,12 +31,10 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("continuous", "continuous_id")`. #' The default (`NA`) will return all columns of the data. -#' @param monitoring_location_arguments A list of arguments that can be queried, +#' @param \dots Arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "continuous")` -#' to get a list of all possible arguments available in this list. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. +#' monitoring_location_ids. See `make_monitoring_location_arguments()` +#' to get a list of all possible arguments available. #' @seealso [make_monitoring_location_arguments()] #' @inheritParams check_arguments_non_api #' @inheritParams check_arguments_api @@ -82,10 +80,8 @@ #' last_modified = "P7D") #' #' dane <- read_waterdata_continuous( -#' monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County" -#' ), +#' state_name = "Wisconsin", +#' county_name = "Dane County", #' parameter_code = "00060", #' time = "P1D") #' @@ -135,9 +131,6 @@ read_waterdata_continuous <- function( time = NA_character_, skipGeometry = TRUE, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments( - service = "continuous" - ), ..., convertType = getOption("dataRetrieval.convertType"), limit = getOption("dataRetrieval.limit"), @@ -147,13 +140,12 @@ read_waterdata_continuous <- function( ) { service <- "continuous" output_id <- "continuous_id" - rlang::check_dots_empty() args <- mget(names(formals())) args <- cleanup_arguments( args = args, - monitoring_location_arguments = monitoring_location_arguments, + monitoring_location_arguments = list(...), service = service ) diff --git a/R/read_waterdata_field_measurements.R b/R/read_waterdata_field_measurements.R index a9d8b1bd..c994aa5d 100644 --- a/R/read_waterdata_field_measurements.R +++ b/R/read_waterdata_field_measurements.R @@ -37,12 +37,10 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("field-measurements", "field_measurement_id")`. #' The default (`NA`) will return all columns of the data. -#' @param monitoring_location_arguments A list of arguments that can be queried, +#' @param \dots Arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "field-measurements")` -#' to get a list of all possible arguments available in this list. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. +#' monitoring_location_ids. See `make_monitoring_location_arguments()` +#' to get a list of all possible arguments available. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] @@ -89,10 +87,8 @@ #' parameter_code = "00060") #' #' dane <- read_waterdata_field_measurements( -#' monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County" -#' ), +#' state_name = "Wisconsin", +#' county_name = "Dane County", #' parameter_code = "00060", #' time = "P30D") #' @@ -118,9 +114,6 @@ read_waterdata_field_measurements <- function( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments( - service = "field-measurements" - ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -130,13 +123,12 @@ read_waterdata_field_measurements <- function( ) { service <- "field-measurements" output_id <- "field_measurement_id" - rlang::check_dots_empty() args <- mget(names(formals())) args <- cleanup_arguments( args = args, - monitoring_location_arguments = monitoring_location_arguments, + monitoring_location_arguments = list(...), service = service ) diff --git a/R/read_waterdata_latest_continuous.R b/R/read_waterdata_latest_continuous.R index ca3499b9..da859f87 100644 --- a/R/read_waterdata_latest_continuous.R +++ b/R/read_waterdata_latest_continuous.R @@ -23,12 +23,10 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("latest-continuous", "latest_continuous_id")`. #' The default (`NA`) will return all columns of the data. -#' @param monitoring_location_arguments A list of arguments that can be queried, +#' @param \dots Arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-continuous")` -#' to get a list of all possible arguments available in this list. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. +#' monitoring_location_ids. See `make_monitoring_location_arguments()` +#' to get a list of all possible arguments available. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] @@ -68,10 +66,8 @@ #' last_modified = "P7D") #' #' dane <- read_waterdata_latest_continuous( -#' monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County" -#' ), +#' state_name = "Wisconsin", +#' county_name = "Dane County", #' parameter_code = "00060", #' time = "P1D") #' @@ -89,9 +85,6 @@ read_waterdata_latest_continuous <- function( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments( - service = "latest-continuous" - ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -101,13 +94,12 @@ read_waterdata_latest_continuous <- function( ) { service <- "latest-continuous" output_id <- "latest_continuous_id" - rlang::check_dots_empty() args <- mget(names(formals())) args <- cleanup_arguments( args = args, - monitoring_location_arguments = monitoring_location_arguments, + monitoring_location_arguments = list(...), service = service ) diff --git a/R/read_waterdata_latest_daily.R b/R/read_waterdata_latest_daily.R index b1236d8b..8a329c03 100644 --- a/R/read_waterdata_latest_daily.R +++ b/R/read_waterdata_latest_daily.R @@ -25,12 +25,10 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("latest-daily", "latest_daily_id")`. #' The default (`NA`) will return all columns of the data. -#' @param monitoring_location_arguments A list of arguments that can be queried, +#' @param \dots Arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-daily")` -#' to get a list of all possible arguments available in this list. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. +#' monitoring_location_ids. See `make_monitoring_location_arguments()` +#' to get a list of all possible arguments available. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] @@ -63,10 +61,8 @@ #' parameter_code = c("00060", "00010")) #' #' dane <- read_waterdata_latest_daily( -#' monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County" -#' ), +#' state_name = "Wisconsin", +#' county_name = "Dane County", #' parameter_code = "00060", #' time = "P7D") #' @@ -85,9 +81,6 @@ read_waterdata_latest_daily <- function( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments( - service = "latest-daily" - ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -97,13 +90,12 @@ read_waterdata_latest_daily <- function( ) { service <- "latest-daily" output_id <- "latest_daily_id" - rlang::check_dots_empty() args <- mget(names(formals())) args <- cleanup_arguments( args = args, - monitoring_location_arguments = monitoring_location_arguments, + monitoring_location_arguments = list(...), service = service ) diff --git a/R/read_waterdata_latest_field.R b/R/read_waterdata_latest_field.R index 7839aa47..606fa9b4 100644 --- a/R/read_waterdata_latest_field.R +++ b/R/read_waterdata_latest_field.R @@ -29,8 +29,10 @@ #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-field-measurements")` #' to get a list of all possible arguments available in this list. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. +#' @param \dots Arguments that can be queried, +#' but are not returned. These are used as alternatives to specifying specific +#' monitoring_location_ids. See `make_monitoring_location_arguments()` +#' to get a list of all possible arguments available. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] @@ -55,10 +57,8 @@ #' "USGS-14202650")) #' #' dane <- read_waterdata_latest_field_measurements( -#' monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County" -#' ), +#' state_name = "Wisconsin", +#' county_name = "Dane County", #' time = "P30D") #' #' } @@ -76,9 +76,6 @@ read_waterdata_latest_field_measurements <- function( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments( - service = "latest-field-measurements" - ), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -88,13 +85,12 @@ read_waterdata_latest_field_measurements <- function( ) { service <- "latest-field-measurements" output_id <- "latest_field_id" - rlang::check_dots_empty() args <- mget(names(formals())) args <- cleanup_arguments( args = args, - monitoring_location_arguments = monitoring_location_arguments, + monitoring_location_arguments = list(...), service = service ) diff --git a/R/read_waterdata_peaks.R b/R/read_waterdata_peaks.R index 6caef0e0..871d7f50 100644 --- a/R/read_waterdata_peaks.R +++ b/R/read_waterdata_peaks.R @@ -36,12 +36,10 @@ #' or whether to set those dates to `NA` (`FALSE`). Peaks with uncertain days #' are stored on the first of the month, and those with uncertain #' month stored on January 1. Default is `FALSE`. -#' @param monitoring_location_arguments A list of arguments that can be queried, +#' @param \dots Arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "peaks")` -#' to get a list of all possible arguments available in this list. -#' @param \dots Not used. Included to help differentiate official Water Data API arguments -#' from more seldom used, optional dataRetrieval-specific arguments. +#' monitoring_location_ids. See `make_monitoring_location_arguments()` +#' to get a list of all possible arguments available. #' @inheritParams check_arguments_api #' @inheritParams check_arguments_non_api #' @seealso [make_monitoring_location_arguments()] @@ -62,10 +60,8 @@ #' parameter_code = "00060") #' #' dane <- read_waterdata_peaks( -#' monitoring_location_arguments = list( -#' state_name = "Wisconsin", -#' county_name = "Dane County" -#' ), +#' state_name = "Wisconsin", +#' county_name = "Dane County", #' parameter_code = "00060") #' #' incomplete_dates_not_allowed <- read_waterdata_peaks( @@ -97,9 +93,6 @@ read_waterdata_peaks <- function( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments( - service = "peaks" - ), ..., allow_incomplete_dates = FALSE, convertType = getOption("dataRetrieval.convertType"), @@ -110,13 +103,12 @@ read_waterdata_peaks <- function( ) { service <- "peaks" output_id <- "peak_id" - rlang::check_dots_empty() args <- mget(names(formals())) args <- cleanup_arguments( args = args, - monitoring_location_arguments = monitoring_location_arguments, + monitoring_location_arguments = list(...), service = service ) diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index b49c1145..e21deaa4 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -17,8 +17,6 @@ read_waterdata_continuous( time = NA_character_, skipGeometry = TRUE, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments(service = - "continuous"), ..., convertType = getOption("dataRetrieval.convertType"), limit = getOption("dataRetrieval.limit"), @@ -92,13 +90,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{monitoring_location_arguments}{A list of arguments that can be queried, +\item{\dots}{Arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "continuous")} -to get a list of all possible arguments available in this list.} - -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} +monitoring_location_ids. See \code{make_monitoring_location_arguments()} +to get a list of all possible arguments available.} \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string @@ -178,10 +173,8 @@ multi_site2 <- read_waterdata_continuous(monitoring_location_id = c("USGS-45160 last_modified = "P7D") dane <- read_waterdata_continuous( - monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County" - ), + state_name = "Wisconsin", + county_name = "Dane County", parameter_code = "00060", time = "P1D") diff --git a/man/read_waterdata_field_measurements.Rd b/man/read_waterdata_field_measurements.Rd index 57462756..4adee87c 100644 --- a/man/read_waterdata_field_measurements.Rd +++ b/man/read_waterdata_field_measurements.Rd @@ -24,8 +24,6 @@ read_waterdata_field_measurements( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments(service = - "field-measurements"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -120,13 +118,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{monitoring_location_arguments}{A list of arguments that can be queried, +\item{\dots}{Arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "field-measurements")} -to get a list of all possible arguments available in this list.} - -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} +monitoring_location_ids. See \code{make_monitoring_location_arguments()} +to get a list of all possible arguments available.} \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string @@ -214,10 +209,8 @@ surface_water <- read_waterdata_field_measurements( parameter_code = "00060") dane <- read_waterdata_field_measurements( - monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County" - ), + state_name = "Wisconsin", + county_name = "Dane County", parameter_code = "00060", time = "P30D") diff --git a/man/read_waterdata_latest_continuous.Rd b/man/read_waterdata_latest_continuous.Rd index 1cf2db82..ea1da5b8 100644 --- a/man/read_waterdata_latest_continuous.Rd +++ b/man/read_waterdata_latest_continuous.Rd @@ -17,8 +17,6 @@ read_waterdata_latest_continuous( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments(service = - "latest-continuous"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -92,13 +90,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{monitoring_location_arguments}{A list of arguments that can be queried, +\item{\dots}{Arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-continuous")} -to get a list of all possible arguments available in this list.} - -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} +monitoring_location_ids. See \code{make_monitoring_location_arguments()} +to get a list of all possible arguments available.} \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string @@ -181,10 +176,8 @@ multi_site2 <- read_waterdata_latest_continuous(monitoring_location_id = c("USG last_modified = "P7D") dane <- read_waterdata_latest_continuous( - monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County" - ), + state_name = "Wisconsin", + county_name = "Dane County", parameter_code = "00060", time = "P1D") diff --git a/man/read_waterdata_latest_daily.Rd b/man/read_waterdata_latest_daily.Rd index c83c8b8d..bdf08ab6 100644 --- a/man/read_waterdata_latest_daily.Rd +++ b/man/read_waterdata_latest_daily.Rd @@ -18,8 +18,6 @@ read_waterdata_latest_daily( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments(service = - "latest-daily"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -97,13 +95,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{monitoring_location_arguments}{A list of arguments that can be queried, +\item{\dots}{Arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-daily")} -to get a list of all possible arguments available in this list.} - -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} +monitoring_location_ids. See \code{make_monitoring_location_arguments()} +to get a list of all possible arguments available.} \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string @@ -179,10 +174,8 @@ multi_site <- read_waterdata_latest_daily(monitoring_location_id = c("USGS-0149 parameter_code = c("00060", "00010")) dane <- read_waterdata_latest_daily( - monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County" - ), + state_name = "Wisconsin", + county_name = "Dane County", parameter_code = "00060", time = "P7D") diff --git a/man/read_waterdata_latest_field_measurements.Rd b/man/read_waterdata_latest_field_measurements.Rd index 895bd2a9..70c63746 100644 --- a/man/read_waterdata_latest_field_measurements.Rd +++ b/man/read_waterdata_latest_field_measurements.Rd @@ -18,8 +18,6 @@ read_waterdata_latest_field_measurements( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments(service = - "latest-field-measurements"), ..., convertType = getOption("dataRetrieval.convertType"), no_paging = getOption("dataRetrieval.no_paging"), @@ -93,13 +91,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{monitoring_location_arguments}{A list of arguments that can be queried, +\item{\dots}{Arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-field-measurements")} -to get a list of all possible arguments available in this list.} - -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} +monitoring_location_ids. See \code{make_monitoring_location_arguments()} +to get a list of all possible arguments available.} \item{convertType}{logical, defaults to TRUE. If \code{TRUE}, the function will convert the data to dates, any qualifiers to string @@ -127,6 +122,11 @@ Setting to \code{NA} will eliminate site chunking, giving users full control.} \item{attach_request}{logical, defaults to TRUE. If set to \code{TRUE}, the full request sent to the Water Data API is attached as an attribute to the data set.} + +\item{monitoring_location_arguments}{A list of arguments that can be queried, +but are not returned. These are used as alternatives to specifying specific +monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-field-measurements")} +to get a list of all possible arguments available in this list.} } \description{ Field measurements are physically measured values collected during a visit to the monitoring location. Field measurements consist of measurements of gage height and discharge, and readings of groundwater levels, and are primarily used as calibration readings for the automated sensors collecting continuous data. They are collected at a low frequency, and delivery of the data in WDFN may be delayed due to data processing time. @@ -167,10 +167,8 @@ multi_site <- read_waterdata_latest_field_measurements(monitoring_location_id = "USGS-14202650")) dane <- read_waterdata_latest_field_measurements( - monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County" - ), + state_name = "Wisconsin", + county_name = "Dane County", time = "P30D") } diff --git a/man/read_waterdata_peaks.Rd b/man/read_waterdata_peaks.Rd index 3ef0022b..4a758af8 100644 --- a/man/read_waterdata_peaks.Rd +++ b/man/read_waterdata_peaks.Rd @@ -22,7 +22,6 @@ read_waterdata_peaks( skipGeometry = NA, time = NA_character_, bbox = NA, - monitoring_location_arguments = make_monitoring_location_arguments(service = "peaks"), ..., allow_incomplete_dates = FALSE, convertType = getOption("dataRetrieval.convertType"), @@ -105,13 +104,10 @@ vector structured: c(xmin,ymin,xmax,ymax). Another way to think of it is c(Western-most longitude, Southern-most latitude, Eastern-most longitude, Northern-most longitude).} -\item{monitoring_location_arguments}{A list of arguments that can be queried, +\item{\dots}{Arguments that can be queried, but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "peaks")} -to get a list of all possible arguments available in this list.} - -\item{\dots}{Not used. Included to help differentiate official Water Data API arguments -from more seldom used, optional dataRetrieval-specific arguments.} +monitoring_location_ids. See \code{make_monitoring_location_arguments()} +to get a list of all possible arguments available.} \item{allow_incomplete_dates}{Specifically in the peaks data, exact peak dates are not always known. Sometimes peaks are known just for the year, sometimes @@ -183,10 +179,8 @@ dv_data_sf <- read_waterdata_peaks( parameter_code = "00060") dane <- read_waterdata_peaks( - monitoring_location_arguments = list( - state_name = "Wisconsin", - county_name = "Dane County" - ), + state_name = "Wisconsin", + county_name = "Dane County", parameter_code = "00060") incomplete_dates_not_allowed <- read_waterdata_peaks( From 3444e4ec34469c2ed71506bb70544cba63cb1192 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 9 Jul 2026 13:45:34 -0500 Subject: [PATCH 13/17] Added news --- NEWS | 13 ++++++++++++- R/read_waterdata_continuous.R | 2 +- R/read_waterdata_daily.R | 9 +++++---- man/read_waterdata_continuous.Rd | 2 +- man/read_waterdata_daily.Rd | 9 +++++---- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 19d5dcc0..4929f5c3 100644 --- a/NEWS +++ b/NEWS @@ -2,8 +2,19 @@ dataRetrieval 2.7.26 =================== * Added suite of read_ngwmn to access new National Groundwater Monitoring Network API. -* Added read_waterdata_use to access USGS's National Water Availability +* Added read_wateruse to access USGS's National Water Availability Assessment Data Companion API service. +* Created make_monitoring_location_arguments to help users understand +what new optional arguments are available in many of the read_waterdata functions. +* Added ability to use `...` in the Water Data functions for: daily, latest-continuous, +field-measurements, latest-daily, latest-field-measurements, continuous, and peaks. +The "..." argument can now accept any parameter that is output from the new +make_monitoring_location_arguments function. +* Added "q" argument to read_waterdata_monitoring_location. Full-text search across +the most relevant text fields for this collection (e.g. site name, identifier, +number, state, county, and site type). +* Added "skipGeometry" argument to read_waterdata_continuous. Previously geometry +wasn't included with continuous data, but now is supported. dataRetrieval 2.7.25 =================== diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index 92bfa4db..8d0aca64 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -6,7 +6,7 @@ #' a single request. If no "time" is specified, the service will return the #' last single year of data. If this is a bottleneck, please check back #' for new direct download functions that are expected to be available sometime -#' in 2026. +#' in 2027. #' #' #' @export diff --git a/R/read_waterdata_daily.R b/R/read_waterdata_daily.R index 88b48a44..8eb34ba6 100644 --- a/R/read_waterdata_daily.R +++ b/R/read_waterdata_daily.R @@ -77,10 +77,11 @@ #' parameter_code = "00060", #' time = c("2021-01-01", "2022-01-01")) #' -#' dv_dane <- read_waterdata_daily(state_name = "Wisconsin", -#' county_name = "Dane County", -#' parameter_code = "00060", -#' time = "P7D") +#' dv_dane <- read_waterdata_daily( +#' state_name = "Wisconsin", +#' county_name = "Dane County", +#' parameter_code = "00060", +#' time = "P7D") #' #' } read_waterdata_daily <- function( diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index e21deaa4..55f87fd9 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -129,7 +129,7 @@ Currently, the services only allow up to 3 years of data to be requested with a single request. If no "time" is specified, the service will return the last single year of data. If this is a bottleneck, please check back for new direct download functions that are expected to be available sometime -in 2026. +in 2027. } \details{ You can also use a vector of length 2 for any time queries (such as time diff --git a/man/read_waterdata_daily.Rd b/man/read_waterdata_daily.Rd index 5ef5297a..6f35753b 100644 --- a/man/read_waterdata_daily.Rd +++ b/man/read_waterdata_daily.Rd @@ -190,10 +190,11 @@ dv_data_no_request <- read_waterdata_daily(monitoring_location_id = site, parameter_code = "00060", time = c("2021-01-01", "2022-01-01")) -dv_dane <- read_waterdata_daily(state_name = "Wisconsin", - county_name = "Dane County", - parameter_code = "00060", - time = "P7D") +dv_dane <- read_waterdata_daily( + state_name = "Wisconsin", + county_name = "Dane County", + parameter_code = "00060", + time = "P7D") } \dontshow{\}) # examplesIf} From c16f21837054079cd1374f7186d99b64fc2497aa Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 9 Jul 2026 13:46:53 -0500 Subject: [PATCH 14/17] sp --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 4929f5c3..4f87cf0d 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,7 @@ Assessment Data Companion API service. what new optional arguments are available in many of the read_waterdata functions. * Added ability to use `...` in the Water Data functions for: daily, latest-continuous, field-measurements, latest-daily, latest-field-measurements, continuous, and peaks. -The "..." argument can now accept any parameter that is output from the new +The "..." argument can now accept any parameter that is output from the make_monitoring_location_arguments function. * Added "q" argument to read_waterdata_monitoring_location. Full-text search across the most relevant text fields for this collection (e.g. site name, identifier, From 5b178bd37bc6d194700501203c7272a0f4ca21c1 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 9 Jul 2026 14:16:18 -0500 Subject: [PATCH 15/17] cleanup arg --- R/read_waterdata_latest_field.R | 4 ---- man/read_waterdata_latest_field_measurements.Rd | 5 ----- 2 files changed, 9 deletions(-) diff --git a/R/read_waterdata_latest_field.R b/R/read_waterdata_latest_field.R index 606fa9b4..20f86579 100644 --- a/R/read_waterdata_latest_field.R +++ b/R/read_waterdata_latest_field.R @@ -25,10 +25,6 @@ #' Available options are: #' `r dataRetrieval:::get_properties_for_docs("latest-field-measurements", "latest_field_id")`. #' The default (`NA`) will return all columns of the data. -#' @param monitoring_location_arguments A list of arguments that can be queried, -#' but are not returned. These are used as alternatives to specifying specific -#' monitoring_location_ids. Run `make_monitoring_location_arguments(service = "latest-field-measurements")` -#' to get a list of all possible arguments available in this list. #' @param \dots Arguments that can be queried, #' but are not returned. These are used as alternatives to specifying specific #' monitoring_location_ids. See `make_monitoring_location_arguments()` diff --git a/man/read_waterdata_latest_field_measurements.Rd b/man/read_waterdata_latest_field_measurements.Rd index 70c63746..33f723e6 100644 --- a/man/read_waterdata_latest_field_measurements.Rd +++ b/man/read_waterdata_latest_field_measurements.Rd @@ -122,11 +122,6 @@ Setting to \code{NA} will eliminate site chunking, giving users full control.} \item{attach_request}{logical, defaults to TRUE. If set to \code{TRUE}, the full request sent to the Water Data API is attached as an attribute to the data set.} - -\item{monitoring_location_arguments}{A list of arguments that can be queried, -but are not returned. These are used as alternatives to specifying specific -monitoring_location_ids. Run \code{make_monitoring_location_arguments(service = "latest-field-measurements")} -to get a list of all possible arguments available in this list.} } \description{ Field measurements are physically measured values collected during a visit to the monitoring location. Field measurements consist of measurements of gage height and discharge, and readings of groundwater levels, and are primarily used as calibration readings for the automated sensors collecting continuous data. They are collected at a low frequency, and delivery of the data in WDFN may be delayed due to data processing time. From 6d0ea7463bbbbc54cb236e65609330fae001ac16 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 13 Jul 2026 08:15:46 -0500 Subject: [PATCH 16/17] get NEWS added to pkgdown --- NEWS => NEWS.md | 15 ++++----------- _pkgdown.yml | 4 ++++ 2 files changed, 8 insertions(+), 11 deletions(-) rename NEWS => NEWS.md (96%) diff --git a/NEWS b/NEWS.md similarity index 96% rename from NEWS rename to NEWS.md index 4f87cf0d..a7d1824f 100644 --- a/NEWS +++ b/NEWS.md @@ -2,19 +2,12 @@ dataRetrieval 2.7.26 =================== * Added suite of read_ngwmn to access new National Groundwater Monitoring Network API. -* Added read_wateruse to access USGS's National Water Availability -Assessment Data Companion API service. +* Added read_wateruse to access USGS's National Water Availability Assessment Data Companion API service. * Created make_monitoring_location_arguments to help users understand what new optional arguments are available in many of the read_waterdata functions. -* Added ability to use `...` in the Water Data functions for: daily, latest-continuous, -field-measurements, latest-daily, latest-field-measurements, continuous, and peaks. -The "..." argument can now accept any parameter that is output from the -make_monitoring_location_arguments function. -* Added "q" argument to read_waterdata_monitoring_location. Full-text search across -the most relevant text fields for this collection (e.g. site name, identifier, -number, state, county, and site type). -* Added "skipGeometry" argument to read_waterdata_continuous. Previously geometry -wasn't included with continuous data, but now is supported. +* Added ability to use `...` in the Water Data functions for: daily, latest-continuous, field-measurements, latest-daily, latest-field-measurements, continuous, and peaks. The "..." argument can now accept any parameter that is output from the make_monitoring_location_arguments function. +* Added "q" argument to read_waterdata_monitoring_location. Full-text search across the most relevant text fields for this collection (e.g. site name, identifier, number, state, county, and site type). +* Added "skipGeometry" argument to read_waterdata_continuous. Previously geometry wasn't included with continuous data, but now is supported. dataRetrieval 2.7.25 =================== diff --git a/_pkgdown.yml b/_pkgdown.yml index a95d78a1..86ee1aad 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -65,6 +65,10 @@ navbar: - text: How to Contribute href: articles/Contributing.html right: + - text: News + href: news/index.html + - icon: fa-gitlab fa-lg + href: https://code.usgs.gov/water/dataRetrieval - icon: fa-github fa-lg href: https://github.com/DOI-USGS/dataRetrieval reference: From d12f9c335f866eb049f7acab79570cc332d9b9bb Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 13 Jul 2026 08:47:11 -0500 Subject: [PATCH 17/17] with logo --- .github/workflows/pkgdown.yaml | 3 ++- .gitlab-ci.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 38eef4ab..06e731e8 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -74,7 +74,8 @@ jobs: - name: Build site run: | pkgdown::build_site(override = list(destination = "public")) | - file.copy(from = "./public/articles/logo.png",to = "./public/reference/logo.png") + file.copy(from = "./public/articles/logo.png",to = "./public/reference/logo.png") | + file.copy(from = "./public/articles/logo.png", to = "./public/news/logo.png") shell: Rscript {0} - name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 565ddcb1..660a9475 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -141,7 +141,8 @@ pages: - | Rscript -e ' pkgdown::build_site(override = list(destination = "public")) - file.copy(from = "./public/articles/logo.png", to = "./public/reference/logo.png")' + file.copy(from = "./public/articles/logo.png", to = "./public/reference/logo.png") + file.copy(from = "./public/articles/logo.png", to = "./public/news/logo.png")' - quarto render artifacts: paths: