From 10ad022ba547e869e53a52a8c61f34aa08b352be Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Fri, 23 Jan 2026 12:44:09 -0600 Subject: [PATCH 01/19] Fix link --- README.Rmd | 2 +- README.md | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.Rmd b/README.Rmd index b57d8814..1c909faf 100644 --- a/README.Rmd +++ b/README.Rmd @@ -23,7 +23,7 @@ library(dataRetrieval) # dataRetrieval -[![CRAN version](http://www.r-pkg.org/badges/version/dataRetrieval)](https://cran.r-project.org/package=EGRET) +[![CRAN version](http://www.r-pkg.org/badges/version/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval) [![](http://cranlogs.r-pkg.org/badges/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval) [![](http://cranlogs.r-pkg.org/badges/grand-total/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval) diff --git a/README.md b/README.md index 47b5fad4..8b8c510a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dataRetrieval [![CRAN -version](http://www.r-pkg.org/badges/version/dataRetrieval)](https://cran.r-project.org/package=EGRET) +version](http://www.r-pkg.org/badges/version/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval) [![](http://cranlogs.r-pkg.org/badges/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval) [![](http://cranlogs.r-pkg.org/badges/grand-total/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval) @@ -177,7 +177,7 @@ citation(package = "dataRetrieval") #> title = {dataRetrieval: R packages for discovering and retrieving water data available from U.S. federal hydrologic web services}, #> publisher = {U.S. Geological Survey}, #> address = {Reston, VA}, -#> version = {2.7.21}, +#> version = {2.7.22}, #> institution = {U.S. Geological Survey}, #> year = {2025}, #> doi = {10.5066/P9X4L3GE}, @@ -200,18 +200,18 @@ dv <- readNWISdv("09010500", "00060") NWIScitation <- create_NWIS_bib(dv) NWIScitation -#> U.S. Geological Survey (2025). _National Water Information System data +#> U.S. Geological Survey (2026). _National Water Information System data #> available on the World Wide Web (USGS Water Data for the Nation)_. -#> doi:10.5066/F7P55KJN , Accessed Dec -#> 03, 2025, +#> doi:10.5066/F7P55KJN , Accessed Jan +#> 23, 2026, #> . print(NWIScitation, style = "Bibtex") #> @Manual{, #> title = {National Water Information System data available on the World Wide Web (USGS Water Data for the Nation)}, #> author = {{U.S. Geological Survey}}, #> doi = {10.5066/F7P55KJN}, -#> note = {Accessed Dec 03, 2025}, -#> year = {2025}, +#> note = {Accessed Jan 23, 2026}, +#> year = {2026}, #> url = {https://waterservices.usgs.gov/nwis/dv/?site=09010500&format=waterml%2C1.1&ParameterCd=00060&StatCd=00003&startDT=1851-01-01}, #> } ``` @@ -232,17 +232,17 @@ SC <- readWQPqw(siteNumbers = "USGS-05288705", WQPcitation <- create_WQP_bib(SC) WQPcitation -#> National Water Quality Monitoring Council (2025). _Water Quality +#> National Water Quality Monitoring Council (2026). _Water Quality #> Portal_. doi:10.5066/P9QRKUVJ , -#> Accessed Dec 03, 2025, +#> Accessed Jan 23, 2026, #> . print(WQPcitation, style = "Bibtex") #> @Manual{, #> title = {Water Quality Portal}, #> author = {{National Water Quality Monitoring Council}}, #> doi = {10.5066/P9QRKUVJ}, -#> note = {Accessed Dec 03, 2025}, -#> year = {2025}, +#> note = {Accessed Jan 23, 2026}, +#> year = {2026}, #> url = {https://www.waterqualitydata.us/data/Result/search?siteid=USGS-05288705&count=no&pCode=00300&mimeType=csv}, #> } ``` From 019330844f82d279bc16aca1da406db7660c9344 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 2 Feb 2026 12:32:14 -0600 Subject: [PATCH 02/19] fix some date issues --- R/construct_api_requests.R | 124 +++++++++++++++++++++++---------- R/importRDB1.R | 8 ++- tests/testthat/tests_general.R | 80 +++++++++++++++++++++ 3 files changed, 174 insertions(+), 38 deletions(-) diff --git a/R/construct_api_requests.R b/R/construct_api_requests.R index 6ed96425..fe761331 100644 --- a/R/construct_api_requests.R +++ b/R/construct_api_requests.R @@ -260,6 +260,7 @@ switch_arg_id <- function(ls, id_name, service){ #' #' end <- c(NA, "2021-01-01") #' dataRetrieval:::format_api_dates(end) +#' dataRetrieval:::format_api_dates(end, TRUE) #' #' end <- c(NA, as.POSIXct("2021-01-01 12:15:00")) #' dataRetrieval:::format_api_dates(end) @@ -287,57 +288,108 @@ switch_arg_id <- function(ls, id_name, service){ #' #' time = c("2014-05-01T00:00Z", "2014-05-01T12:00Z") #' dataRetrieval:::format_api_dates(time) +#' +#' start <- "2025-10-01" +#' end <- Sys.Date() +#' dataRetrieval:::format_api_dates(c(start, end), date = TRUE) format_api_dates <- function(datetime, date = FALSE){ if(is.character(datetime)){ datetime[datetime == ""] <- NA } - if(!any(isTRUE(all(is.na(datetime))) | isTRUE(is.null(datetime)))){ - if(length(datetime) == 1){ - # If the user has "P" or the "/" we assume they know what they are doing - if(grepl("P", datetime, ignore.case = TRUE) | - grepl("/", datetime)){ - return(datetime) - } else { - datetime1 <- tryCatch({ - lubridate::as_datetime(datetime) - }, - warning = function(w) { - strptime(datetime, format = "%Y-%m-%dT%H:%MZ", tz = "UTC") - }) - if(date){ - datetime <- format(datetime1, "%Y-%m-%d") - } else { - datetime <- lubridate::format_ISO8601(datetime1, usetz = "Z") - } - } - } else if (length(datetime) == 2) { - - datetime1 <- tryCatch({ - lubridate::as_datetime(datetime) - }, - warning = function(w) { - strptime(datetime, format = "%Y-%m-%dT%H:%MZ", tz = "UTC") - }) - + if(all(is.na(datetime))){ + return(NA) + } + + if(all(is.null(datetime))){ + return(NA) + } + + if(length(datetime) > 2){ + stop("datetime should only include 1-2 values") + } + + if(length(datetime) == 1){ + # If the user has "P" or the "/" we assume they know what they are doing + if(grepl("P", datetime, ignore.case = TRUE) | + grepl("/", datetime)){ + return(datetime) + } else { + if(date){ - datetime <- paste0(format(datetime1, "%Y-%m-%d"), collapse = "/") + datetime <- get_Date(datetime) } else { - datetime <- paste0(lubridate::format_ISO8601(datetime1, usetz = "Z"), - collapse = "/") + datetime1 <- get_dateTime(datetime) + datetime <- lubridate::format_ISO8601(datetime1, usetz = "Z") } + } + } else if (length(datetime) == 2) { - datetime <- gsub("NA", "..", datetime) + if(date){ + for(i in seq_along(datetime)){ + datetime[i] <- get_Date(datetime[i]) + } + datetime <- paste0(datetime, collapse = "/") } else { - stop("datetime should only include 1-2 values") + for(i in seq_along(datetime)){ + datetime1 <- get_dateTime(datetime) + } + datetime <- paste0(lubridate::format_ISO8601(datetime1, usetz = "Z"), + collapse = "/") } - } else { - datetime <- NA - } + + datetime <- gsub("NA", "..", datetime) + } + return(datetime) } +get_dateTime <- function(d){ + + temp_date <- tryCatch({ + strptime(d, format = "%Y-%m-%dT%H:%MZ", tz = "UTC") + }) + + if(all(is.na(temp_date))){ + temp_date <- tryCatch({ + lubridate::as_datetime(d) + }, + # warning = function (w){ + # strptime(d, format = "%Y-%m-%dT%H:%MZ", tz = "UTC") + # }, + error = function(e) { + NA + }) + } + + return(temp_date) + +} + +get_Date <- function(d){ + temp_date <- tryCatch({ + as.Date(d) + }, + error = function(e) { + "try again" + }) + + if(is.na(temp_date)){ + return("..") + } else if(as.character(temp_date) == "try again"){ + temp_date <- tryCatch({ + as.Date(as.numeric(d), origin = "1970-01-01") + }, + error = function(e) { + "try again" + }) + } + + return(as.character(temp_date)) +} + + #' Turn request list into POST body cql #' #' @noRd diff --git a/R/importRDB1.R b/R/importRDB1.R index 0fcdfe4f..23fed979 100644 --- a/R/importRDB1.R +++ b/R/importRDB1.R @@ -119,8 +119,12 @@ importRDB1 <- function(obs_url, } doc <- obs_url } - - readr.total <- readr::read_lines(doc) + if(file.exists(doc)){ + readr.total <- readr::read_lines(doc) + } else { + readr.total <- readr::read_lines(I(doc)) + } + if(readr.total[length(readr.total)] == ""){ readr.total <- readr.total[-length(readr.total)] } diff --git a/tests/testthat/tests_general.R b/tests/testthat/tests_general.R index 843952d1..d76504a2 100644 --- a/tests/testthat/tests_general.R +++ b/tests/testthat/tests_general.R @@ -506,3 +506,83 @@ test_that("importWQP convertType", { ) expect_is(lakeSites_chars$lat, "character") }) + +test_that("format_dates", { + + start_end <- c("2021-01-01", "2022-01-01") + expect_equal(dataRetrieval:::format_api_dates(start_end, date = TRUE), + "2021-01-01/2022-01-01") + expect_equal(dataRetrieval:::format_api_dates(start_end, date = FALSE), + "2021-01-01T00:00:00Z/2022-01-01T00:00:00Z") + + start_end <- c("", "") + expect_equal(dataRetrieval:::format_api_dates(start_end), + NA) + + period <- "P7D" + + expect_equal(dataRetrieval:::format_api_dates(period), "P7D") + + start <- c("2021-01-01", NA) + + expect_equal(dataRetrieval:::format_api_dates(start), + "2021-01-01T00:00:00Z/..") + expect_equal(dataRetrieval:::format_api_dates(start, TRUE), + "2021-01-01/..") + + end <- c(NA, "2021-01-01") + + expect_equal(dataRetrieval:::format_api_dates(end), + "../2021-01-01T00:00:00Z") + expect_equal(dataRetrieval:::format_api_dates(end, TRUE), + "../2021-01-01") + + end <- c(NA, as.POSIXct("2021-01-01 12:15:00")) + expect_equal(dataRetrieval:::format_api_dates(end), + "../2021-01-01T18:15:00Z") + + start_end <- as.POSIXct(c("2021-01-01 12:15:00", + "2022-01-01 16:45")) + expect_equal(dataRetrieval:::format_api_dates(start_end), + "2021-01-01T18:15:00Z/2022-01-01T22:45:00Z") + + start_end <- as.POSIXct(c("2021-01-01 12:15:00", + "2022-01-01 16:45"), + tz = "America/New_York") + + expect_equal(dataRetrieval:::format_api_dates(start_end), + "2021-01-01T17:15:00Z/2022-01-01T21:45:00Z") + + # If you don't specify a timezone, it will assume UTC + start_end2 <- c("2021-01-01 12:15:00", "") + expect_equal(dataRetrieval:::format_api_dates(start_end2), + "2021-01-01T12:15:00Z/..") + + # If you do specify a timezone, it should maintain it, but convert to UTC: + start_end2 <- c("2021-01-01T12:15:00-0500", "") + expect_equal(dataRetrieval:::format_api_dates(start_end2), + "2021-01-01T17:15:00Z/..") + + time = c("2014-05-01T00:00:00Z", "2014-05-01T12:00:00Z") + expect_equal(dataRetrieval:::format_api_dates(time), + "2014-05-01T00:00:00Z/2014-05-01T12:00:00Z") + + time = c("2014-05-01T00:00Z", "2014-05-01T12:00Z") + expect_equal(dataRetrieval:::format_api_dates(time), + "2014-05-01T00:00:00Z/2014-05-01T12:00:00Z") + + expect_equal(dataRetrieval:::format_api_dates(c("2010-01-01T00:00Z", NA)), + "2010-01-01T00:00:00Z/..") + + expect_equal(dataRetrieval:::format_api_dates(c("2010-01-01T00:00Z", "2010-01-01T05:00Z")), + "2010-01-01T00:00:00Z/2010-01-01T05:00:00Z") + + start <- "2025-10-01" + end <- Sys.Date() + + expect_equal(dataRetrieval:::format_api_dates(c(start, end), date = TRUE), + "2025-10-01/2026-02-02") + +}) + + From a41a9d188e6c1665e00cab62eafaf073b69ee7e1 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 2 Feb 2026 12:35:05 -0600 Subject: [PATCH 03/19] cleaner --- R/construct_api_requests.R | 3 --- 1 file changed, 3 deletions(-) diff --git a/R/construct_api_requests.R b/R/construct_api_requests.R index fe761331..c6258f20 100644 --- a/R/construct_api_requests.R +++ b/R/construct_api_requests.R @@ -355,9 +355,6 @@ get_dateTime <- function(d){ temp_date <- tryCatch({ lubridate::as_datetime(d) }, - # warning = function (w){ - # strptime(d, format = "%Y-%m-%dT%H:%MZ", tz = "UTC") - # }, error = function(e) { NA }) From db921fc9d27dbac325cba548908eb9450c01c7a6 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 2 Feb 2026 12:52:43 -0600 Subject: [PATCH 04/19] Removed bad test because it assumes a local timezone. Kept it in there to remind myself. --- tests/testthat/tests_general.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/testthat/tests_general.R b/tests/testthat/tests_general.R index d76504a2..3bbb70f0 100644 --- a/tests/testthat/tests_general.R +++ b/tests/testthat/tests_general.R @@ -537,9 +537,10 @@ test_that("format_dates", { expect_equal(dataRetrieval:::format_api_dates(end, TRUE), "../2021-01-01") - end <- c(NA, as.POSIXct("2021-01-01 12:15:00")) - expect_equal(dataRetrieval:::format_api_dates(end), - "../2021-01-01T18:15:00Z") + # Bad test because it assumes a local timezone + # end <- c(NA, as.POSIXct("2021-01-01 12:15:00")) + # expect_equal(dataRetrieval:::format_api_dates(end), + # "../2021-01-01T18:15:00Z") start_end <- as.POSIXct(c("2021-01-01 12:15:00", "2022-01-01 16:45")) From 5f93f39005ddd36ca8653d179f9d800d86345867 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 2 Feb 2026 13:05:39 -0600 Subject: [PATCH 05/19] another implied tz --- tests/testthat/tests_general.R | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/testthat/tests_general.R b/tests/testthat/tests_general.R index 3bbb70f0..d8509273 100644 --- a/tests/testthat/tests_general.R +++ b/tests/testthat/tests_general.R @@ -536,16 +536,17 @@ test_that("format_dates", { "../2021-01-01T00:00:00Z") expect_equal(dataRetrieval:::format_api_dates(end, TRUE), "../2021-01-01") - + # # Bad test because it assumes a local timezone - # end <- c(NA, as.POSIXct("2021-01-01 12:15:00")) - # expect_equal(dataRetrieval:::format_api_dates(end), - # "../2021-01-01T18:15:00Z") - - start_end <- as.POSIXct(c("2021-01-01 12:15:00", - "2022-01-01 16:45")) - expect_equal(dataRetrieval:::format_api_dates(start_end), - "2021-01-01T18:15:00Z/2022-01-01T22:45:00Z") + # This worked locally, but failed on a CI job + # # end <- c(NA, as.POSIXct("2021-01-01 12:15:00")) + # # expect_equal(dataRetrieval:::format_api_dates(end), + # # "../2021-01-01T18:15:00Z") + # + # start_end <- as.POSIXct(c("2021-01-01 12:15:00", + # "2022-01-01 16:45")) + # expect_equal(dataRetrieval:::format_api_dates(start_end), + # "2021-01-01T18:15:00Z/2022-01-01T22:45:00Z") start_end <- as.POSIXct(c("2021-01-01 12:15:00", "2022-01-01 16:45"), From 2afa35d6d0f5f7782132a26cd8e74fc86c7d5252 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Tue, 3 Feb 2026 09:22:09 -0600 Subject: [PATCH 06/19] dur --- tests/testthat/tests_general.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/tests_general.R b/tests/testthat/tests_general.R index d8509273..7e2abd9a 100644 --- a/tests/testthat/tests_general.R +++ b/tests/testthat/tests_general.R @@ -580,7 +580,7 @@ test_that("format_dates", { "2010-01-01T00:00:00Z/2010-01-01T05:00:00Z") start <- "2025-10-01" - end <- Sys.Date() + end <- as.Date("2026-02-02") expect_equal(dataRetrieval:::format_api_dates(c(start, end), date = TRUE), "2025-10-01/2026-02-02") From 6ad31b010ce90835c86958f6f15efbd0089ba9fe Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 5 Feb 2026 07:50:01 -0600 Subject: [PATCH 07/19] Up the version and add Joe. We need to remember to update the authors in the "textVersion" when we do the next official release. --- DESCRIPTION | 4 ++-- inst/CITATION | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ae8947a9..8ab49897 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: dataRetrieval Type: Package Title: Retrieval Functions for USGS and EPA Hydrology and Water Quality Data -Version: 2.7.22.9000 +Version: 2.7.22.9001 Authors@R: c( person("Laura", "DeCicco", role = c("aut","cre"), email = "ldecicco@usgs.gov", @@ -26,7 +26,7 @@ Authors@R: c( comment=c(ORCID = "0000-0003-2521-5043")), person("Lee", "Stanish", role="ctb", comment=c(ORCID = "0000-0002-9775-6861")), - person("Joseph", "Zemmels", role="ctb", + person("Joseph", "Zemmels", role="aut", email = "jzemmels@usgs.gov", comment=c(ORCID = "0009-0008-1463-6313")), person("Elise", "Hinman", role="aut", diff --git a/inst/CITATION b/inst/CITATION index 66487ce2..fa76be87 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -21,11 +21,10 @@ bibentry(bibtype = "Manual", email = "mikecp11@gmail.com", comment=c(ORCID = "0000-0002-5288-8350")), person("Aliesha", "Krall", role="ctb", - email = "akrall@usgs.gov", comment=c(ORCID = "0000-0003-2521-5043")), person("Lee", "Stanish", role="ctb", comment=c(ORCID = "0000-0002-9775-6861")), - person("Joseph", "Zemmels", role="ctb", + person("Joseph", "Zemmels", role="aut", email = "jzemmels@usgs.gov", comment=c(ORCID = "0009-0008-1463-6313")), person("Elise", "Hinman", role="aut", @@ -42,5 +41,5 @@ bibentry(bibtype = "Manual", institution = "U.S. Geological Survey", year = 2025, doi = "10.5066/P9X4L3GE", - textVersion = "De Cicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M., 2025, dataRetrieval: R packages for discovering and retrieving water data available from Federal hydrologic web services, v.2.7.20, doi:10.5066/P9X4L3GE" + textVersion = "De Cicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M., 2025, dataRetrieval: R packages for discovering and retrieving water data available from Federal hydrologic web services, v.2.7.22, doi:10.5066/P9X4L3GE" ) From 30619ad58874c16c59fd4789546157c584860f53 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 5 Feb 2026 07:51:47 -0600 Subject: [PATCH 08/19] updates from roxygen --- man/countyCd.Rd | 11 ++--------- man/dataRetrieval.Rd | 2 +- man/pCodeToName.Rd | 2 +- man/parameterCdFile.Rd | 11 ++--------- man/stateCd.Rd | 11 ++--------- 5 files changed, 8 insertions(+), 29 deletions(-) diff --git a/man/countyCd.Rd b/man/countyCd.Rd index ac2f93ee..144fa0db 100644 --- a/man/countyCd.Rd +++ b/man/countyCd.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dataRetrievals-package.R +% Please edit documentation in R/dataRetrieval-package.R \docType{data} \name{countyCd} \alias{countyCd} @@ -21,14 +21,7 @@ Classic lookup table for counties. Has been replaced in functions with \code{check_waterdata_sample_params("counties")}. } \examples{ -\dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} - -\donttest{ -# Please migrate to: -countyCd <- read_waterdata_metadata("counties") - -} -\dontshow{\}) # examplesIf} +head(countyCd) } \keyword{USGS} \keyword{countyCd} diff --git a/man/dataRetrieval.Rd b/man/dataRetrieval.Rd index b7c949f6..b9fba435 100644 --- a/man/dataRetrieval.Rd +++ b/man/dataRetrieval.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dataRetrievals-package.R +% Please edit documentation in R/dataRetrieval-package.R \docType{package} \name{dataRetrieval} \alias{dataRetrieval} diff --git a/man/pCodeToName.Rd b/man/pCodeToName.Rd index f4489233..f9d8f498 100644 --- a/man/pCodeToName.Rd +++ b/man/pCodeToName.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dataRetrievals-package.R +% Please edit documentation in R/dataRetrieval-package.R \docType{data} \name{pCodeToName} \alias{pCodeToName} diff --git a/man/parameterCdFile.Rd b/man/parameterCdFile.Rd index 40c5bc04..84bff3e7 100644 --- a/man/parameterCdFile.Rd +++ b/man/parameterCdFile.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dataRetrievals-package.R +% Please edit documentation in R/dataRetrieval-package.R \docType{data} \name{parameterCdFile} \alias{parameterCdFile} @@ -21,12 +21,5 @@ parameter_units \tab character \tab Parameter units\cr Complete list of USGS parameter codes as of Oct. 24, 2024. } \examples{ -\dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} - -\donttest{ -# Please migrate to: -parameterCds <- read_waterdata_metadata("parameter-codes") - -} -\dontshow{\}) # examplesIf} +head(parameterCdFile[, 1:2]) } diff --git a/man/stateCd.Rd b/man/stateCd.Rd index 51f2e3d7..e858ce62 100644 --- a/man/stateCd.Rd +++ b/man/stateCd.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dataRetrievals-package.R +% Please edit documentation in R/dataRetrieval-package.R \docType{data} \name{stateCd} \alias{stateCd} @@ -20,14 +20,7 @@ Classic lookup table for states. Has been replaced in functions with \code{check_waterdata_sample_params("states")}. } \examples{ -\dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} - -\donttest{ -# Please migrate to: -stateCd <- read_waterdata_metadata("states") - -} -\dontshow{\}) # examplesIf} +head(stateCd) } \keyword{USGS} \keyword{stateCd} From f5b245e5a0b3ef7ebf7814c8fee83faf4923c788 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 5 Feb 2026 08:22:46 -0600 Subject: [PATCH 09/19] Add link --- _pkgdown.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index acc31758..8658ceb4 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -40,6 +40,8 @@ navbar: href: articles/read_waterdata_functions.html - text: Samples Data href: articles/samples_data.html + - text: Daily Statistics + href: articles/daily_data_statistics.html - text: Changes to QW href: articles/qwdata_changes.html - text: Background From d45209b5c10ff1cd13374ea8c68397c92a0ab12d Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 5 Feb 2026 09:25:24 -0600 Subject: [PATCH 10/19] Pretty up the bands --- vignettes/daily_data_statistics.Rmd | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/vignettes/daily_data_statistics.Rmd b/vignettes/daily_data_statistics.Rmd index cd35ad84..e26f645b 100644 --- a/vignettes/daily_data_statistics.Rmd +++ b/vignettes/daily_data_statistics.Rmd @@ -3,8 +3,10 @@ title: "Introducing read_waterdata_statistics_*" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Introducing read_waterdata_statistics_*} - %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} + %\VignetteEngine{knitr::rmarkdown} +editor_options: + chunk_output_type: console --- ```{r, include = FALSE} @@ -95,12 +97,16 @@ doy_perc_bands_plt <- mutate(time_of_year = as.Date(time_of_year, format = "%m-%d")) |> pivot_wider(names_from = percentile, values_from = value) |> ggplot(aes(x = time_of_year)) + - geom_line(aes(y = `0`), linetype = "dashed", linewidth = .2) + - geom_line(aes(y = `100`), linetype = "dashed", linewidth = .2) + - geom_ribbon(aes(ymin = `5`, ymax = `95`), fill = "grey80") + - geom_ribbon(aes(ymin = `10`, ymax = `90`), fill = "grey70") + - geom_ribbon(aes(ymin = `25`, ymax = `75`), fill = "grey60") + - geom_line(aes(y = `50`), linewidth = .2, color = "gray40") + + # geom_line(aes(y = `0`), linetype = "dashed", linewidth = .2) + + # geom_line(aes(y = `100`), linetype = "dashed", linewidth = .2) + + geom_ribbon(aes(ymin = `95`, ymax = `100`), fill = "#292f6b", alpha = 0.7) + + geom_ribbon(aes(ymin = `90`, ymax = `95`), fill = "#5699c0", alpha = 0.7) + + geom_ribbon(aes(ymin = `75`, ymax = `90`), fill = "#aacee0", alpha = 0.7) + + geom_ribbon(aes(ymin = `25`, ymax = `75`), fill = "#e9e9e9", alpha = 0.7) + + geom_ribbon(aes(ymin = `10`, ymax = `25`), fill = "#ebd6ab", alpha = 0.7) + + geom_ribbon(aes(ymin = `5`, ymax = `10`), fill = "#dcb668", alpha = 0.7) + + geom_ribbon(aes(ymin = `0`, ymax = `5`), fill = "#8f4f1f", alpha = 0.7) + + geom_line(aes(y = `50`), linewidth = .2, color = "black") + scale_x_date(date_labels = "%b", date_breaks = "1 month") + labs( x = "Month–day", From e97c3fceebcdb00e1fbf7c854b4d8b6fa22e70b9 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Thu, 5 Feb 2026 09:26:47 -0600 Subject: [PATCH 11/19] More cleanup --- vignettes/daily_data_statistics.Rmd | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/vignettes/daily_data_statistics.Rmd b/vignettes/daily_data_statistics.Rmd index e26f645b..43ca33ed 100644 --- a/vignettes/daily_data_statistics.Rmd +++ b/vignettes/daily_data_statistics.Rmd @@ -97,15 +97,13 @@ doy_perc_bands_plt <- mutate(time_of_year = as.Date(time_of_year, format = "%m-%d")) |> pivot_wider(names_from = percentile, values_from = value) |> ggplot(aes(x = time_of_year)) + - # geom_line(aes(y = `0`), linetype = "dashed", linewidth = .2) + - # geom_line(aes(y = `100`), linetype = "dashed", linewidth = .2) + - geom_ribbon(aes(ymin = `95`, ymax = `100`), fill = "#292f6b", alpha = 0.7) + - geom_ribbon(aes(ymin = `90`, ymax = `95`), fill = "#5699c0", alpha = 0.7) + - geom_ribbon(aes(ymin = `75`, ymax = `90`), fill = "#aacee0", alpha = 0.7) + - geom_ribbon(aes(ymin = `25`, ymax = `75`), fill = "#e9e9e9", alpha = 0.7) + - geom_ribbon(aes(ymin = `10`, ymax = `25`), fill = "#ebd6ab", alpha = 0.7) + - geom_ribbon(aes(ymin = `5`, ymax = `10`), fill = "#dcb668", alpha = 0.7) + - geom_ribbon(aes(ymin = `0`, ymax = `5`), fill = "#8f4f1f", alpha = 0.7) + + geom_ribbon(aes(ymin = `95`, ymax = `100`), fill = "#292f6b") + + geom_ribbon(aes(ymin = `90`, ymax = `95`), fill = "#5699c0") + + geom_ribbon(aes(ymin = `75`, ymax = `90`), fill = "#aacee0") + + geom_ribbon(aes(ymin = `25`, ymax = `75`), fill = "#e9e9e9") + + geom_ribbon(aes(ymin = `10`, ymax = `25`), fill = "#ebd6ab") + + geom_ribbon(aes(ymin = `5`, ymax = `10`), fill = "#dcb668") + + geom_ribbon(aes(ymin = `0`, ymax = `5`), fill = "#8f4f1f") + geom_line(aes(y = `50`), linewidth = .2, color = "black") + scale_x_date(date_labels = "%b", date_breaks = "1 month") + labs( From aad430c9a32a30d758833e04954d2b2f29ac994d Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Fri, 6 Feb 2026 09:32:51 -0600 Subject: [PATCH 12/19] update param comments --- R/construct_api_requests.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/construct_api_requests.R b/R/construct_api_requests.R index c6258f20..e6cceae6 100644 --- a/R/construct_api_requests.R +++ b/R/construct_api_requests.R @@ -238,7 +238,7 @@ switch_arg_id <- function(ls, id_name, service){ #' period requests. #' #' @param datetime character, Date, or POSIX -#' @param format character +#' @param date logical, whether to return Date or POSIX #' #' @noRd #' @return character vector with a length of either 1 or 2. From e2e6e34e8f7edf5c2fb5672d67fe0a963d59d88a Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 9 Feb 2026 12:26:39 -0600 Subject: [PATCH 13/19] update status --- R/construct_api_requests.R | 1 + vignettes/Status.Rmd | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/R/construct_api_requests.R b/R/construct_api_requests.R index e6cceae6..84c4eb31 100644 --- a/R/construct_api_requests.R +++ b/R/construct_api_requests.R @@ -296,6 +296,7 @@ format_api_dates <- function(datetime, date = FALSE){ if(is.character(datetime)){ datetime[datetime == ""] <- NA + datetime <- toupper(datetime) } if(all(is.na(datetime))){ diff --git a/vignettes/Status.Rmd b/vignettes/Status.Rmd index 2e468ae4..d7820e93 100644 --- a/vignettes/Status.Rmd +++ b/vignettes/Status.Rmd @@ -59,12 +59,15 @@ df <- data.frame( "read_waterdata_field_measurements", "read_waterdata_field_measurements", "read_waterdata", - "read_waterdata_continuous", "", + "read_waterdata_continuous", + "", #rating "read_waterdata_stats_por, read_waterdata_stats_daterange", rep("", 3) ), - "Available on (branch)" = c(rep("main (CRAN)", 5), - "develop", "develop", "main (CRAN)", "develop", "", "develop", rep("", 3)) + "Available on (branch)" = c(rep("main (CRAN)", 9), + "", + "develop", + rep("", 3)) ) knitr::kable(df, col.names = c("WaterServices (legacy) function", "Water Data (new) function", "Available on (branch name)")) From ac61e82402fccb1db7548db03801d221b9c8fc65 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Mon, 9 Feb 2026 16:45:05 -0600 Subject: [PATCH 14/19] add UTC tz --- R/read_waterdata_continuous.R | 9 ++++++--- R/rejigger_cols.R | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index 3058de37..aa8a55f4 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -50,9 +50,11 @@ #' pcode <- "72019" #' #' uv_data_trim <- read_waterdata_continuous(monitoring_location_id = site, -#' parameter_code = pcode, -#' properties = c("value", -#' "time")) +#' parameter_code = pcode, +#' properties = c("value", "time"), +#' time = as.POSIXct(c("2026-02-07 12:00", +#' "2026-02-08 12:00"), +#' tz = "America/Chicago")) #' #' uv_data <- read_waterdata_continuous(monitoring_location_id = site, #' parameter_code = pcode, @@ -90,6 +92,7 @@ read_waterdata_continuous <- function(monitoring_location_id = NA_character_, output_id, service) + attr(return_list$time, "tzone") <- "UTC" return(return_list) } diff --git a/R/rejigger_cols.R b/R/rejigger_cols.R index d82f5cb6..1d9dfe23 100644 --- a/R/rejigger_cols.R +++ b/R/rejigger_cols.R @@ -76,9 +76,13 @@ cleanup_cols <- function(df, service){ if("time" %in% names(df)){ if(service == "daily"){ df$time <- as.Date(df$time) - } - # by default, the data is put in POSIXct and seems - # to be pretty smart about the offset/tzone + } else { + attr(df$time, "tzone") <- "UTC" + } + } + + if("last_modified" %in% names(df)){ + attr(df$time, "tzone") <- "UTC" } if("value" %in% names(df)){ From 39f8208989a2a35772f62c77e557b374eb24e7ba Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Tue, 10 Feb 2026 08:02:11 -0600 Subject: [PATCH 15/19] last modified --- R/rejigger_cols.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/rejigger_cols.R b/R/rejigger_cols.R index 1d9dfe23..0d5b8ce3 100644 --- a/R/rejigger_cols.R +++ b/R/rejigger_cols.R @@ -82,7 +82,7 @@ cleanup_cols <- function(df, service){ } if("last_modified" %in% names(df)){ - attr(df$time, "tzone") <- "UTC" + attr(df$last_modified, "tzone") <- "UTC" } if("value" %in% names(df)){ From bad5428024b21b54c57a3a55e262d95d7e5826bb Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Tue, 10 Feb 2026 08:04:22 -0600 Subject: [PATCH 16/19] update docs --- man/read_waterdata_continuous.Rd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index 4542788d..d4c5f25e 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -109,9 +109,11 @@ site <- "USGS-451605097071701" pcode <- "72019" uv_data_trim <- read_waterdata_continuous(monitoring_location_id = site, - parameter_code = pcode, - properties = c("value", - "time")) + parameter_code = pcode, + properties = c("value", "time"), + time = as.POSIXct(c("2026-02-07 12:00", + "2026-02-08 12:00"), + tz = "America/Chicago")) uv_data <- read_waterdata_continuous(monitoring_location_id = site, parameter_code = pcode, From 1043d248978f080bb37a3570cdcde65c9e8822f6 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Tue, 10 Feb 2026 12:19:28 -0600 Subject: [PATCH 17/19] Update docs --- NEWS | 9 +++++-- R/AAA.R | 3 ++- R/construct_api_requests.R | 2 +- R/get_ogc_data.R | 5 +++- R/read_waterdata_continuous.R | 28 +++++++++++++++++---- R/read_waterdata_daily.R | 17 +++++++++---- R/read_waterdata_field_measurements.R | 19 +++++++++----- R/read_waterdata_latest_continuous.R | 10 +++++--- R/read_waterdata_latest_daily.R | 11 +++++--- R/read_waterdata_ts_meta.R | 9 +++++++ R/walk_pages.R | 2 +- man/read_waterdata_continuous.Rd | 27 +++++++++++++++----- man/read_waterdata_daily.Rd | 31 ++++++++++++++++++----- man/read_waterdata_field_measurements.Rd | 32 ++++++++++++++++++------ man/read_waterdata_latest_continuous.Rd | 25 ++++++++++++++---- man/read_waterdata_latest_daily.Rd | 25 ++++++++++++++---- man/read_waterdata_ts_meta.Rd | 29 ++++++++++++++++++--- 17 files changed, 222 insertions(+), 62 deletions(-) diff --git a/NEWS b/NEWS index 23c280b2..b40fa0e6 100644 --- a/NEWS +++ b/NEWS @@ -1,12 +1,17 @@ dataRetrieval 2.7.22.9000 =================== * Added data.table to Imports -* Added data.table importFrom entries to NAMESPACE * Added read_waterdata_stats_por and read_waterdata_stats_daterange to access USGS daily data statistics. * Updated vignettes, examples, and README to reflect new stats functions. * Added tests for read_waterdata_stats functions * Updated next_req_url to allow paging through /statistics API output -* Added deprecate message to readNWISstat function. +* Added deprecate message to readNWISstat function +* Specify "UTC" attribute for returned time +* Added options("dataRetrieval.attach_request" = TRUE) as default to attach the +request object as an attribute to the returned data frames. Setting +options("dataRetrieval.attach_request" = FALSE) will return a data frame without +the request attribute +* Improved time documentation dataRetrieval 2.7.22 diff --git a/R/AAA.R b/R/AAA.R index 526ff10c..eb39a2d1 100644 --- a/R/AAA.R +++ b/R/AAA.R @@ -4,7 +4,8 @@ pkg.env <- new.env() suppressMessages(setAccess("public")) pkg.env$nldi_base <- "https://api.water.usgs.gov/nldi/linked-data/" pkg.env$local_sf <- requireNamespace("sf", quietly = TRUE) - options("dataRetrieval" = list("api_version" = "v0")) + options("dataRetrieval.api_version" = "v0") + options("dataRetrieval.attach_request" = TRUE) services <- c("server", "daily", "time-series-metadata", "monitoring-locations", "latest-continuous", diff --git a/R/construct_api_requests.R b/R/construct_api_requests.R index 84c4eb31..5f56b839 100644 --- a/R/construct_api_requests.R +++ b/R/construct_api_requests.R @@ -173,7 +173,7 @@ check_limits <- function(args){ base_url <- function(){ httr2::request("https://api.waterdata.usgs.gov/ogcapi/") |> - httr2::req_url_path_append(getOption("dataRetrieval")$api_version) + httr2::req_url_path_append(getOption("dataRetrieval.api_version")) } #' Setup the request for a particular endpoint collection diff --git a/R/get_ogc_data.R b/R/get_ogc_data.R index d34a0a76..517ed06f 100644 --- a/R/get_ogc_data.R +++ b/R/get_ogc_data.R @@ -61,7 +61,10 @@ get_ogc_data <- function(args, output_id) } - attr(return_list, "request") <- req + if(getOption("dataRetrieval.attach_request")){ + attr(return_list, "request") <- req + } + attr(return_list, "queryTime") <- Sys.time() return(return_list) } diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index aa8a55f4..89dfc11d 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -15,15 +15,16 @@ #' Multiple monitoring_location_ids can be requested as a character vector. #' @param parameter_code `r get_ogc_params("continuous")$parameter_code` #' Multiple parameter_codes can be requested as a character vector. -#' @param time `r get_ogc_params("continuous")$time`. -#' You can also use a vector of length 2: the first value being the starting date, -#' the second value being the ending date. NA's within the vector indicate a -#' half-bound date. For example, c("2024-01-01", NA) will return all data starting -#' at 2024-01-01. +#' @param time `r get_ogc_params("continuous")$time` +#' +#' See also Details below for more information. +#' #' @param value `r get_ogc_params("continuous")$value` #' @param unit_of_measure `r get_ogc_params("continuous")$unit_of_measure` #' @param approval_status `r get_ogc_params("continuous")$approval_status` #' @param last_modified `r get_ogc_params("continuous")$last_modified` +#' +#' See also Details below for more information. #' @param time_series_id `r get_ogc_params("continuous")$time_series_id` #' Multiple time_series_ids can be requested as a character vector. #' @param qualifier `r get_ogc_params("continuous")$qualifier` @@ -43,6 +44,23 @@ #' be requested from a native csv format. This can be dangerous because the #' data will cut off at 50,000 rows without indication that more data #' is available. Use `TRUE` with caution. +#' +#' @details +#' You can also use a vector of length 2 for any time queries (such as time +#' or last_modified). The first value is the starting date (or datetime), +#' the second value is the ending date(or datetime). +#' NA's within the vector indicate a half-bound date. +#' For example, \code{time = c("2024-01-01", NA)} will return all data starting +#' at 2024-01-01. +#' \code{time = c(NA, "2024-01-01")} will return all data from the beginning of +#' the timeseries until 2024-01-01. +#' By default, time is assumed UTC, although time zone attributes +#' will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", +#' "2021-01-01 12:00"), tz = "America/New_York")} will request data that between +#' noon and 2pm eastern time on 2021-01-01. +#' All time values RETURNED from the service are UTC with the exception of +#' daily data, which returns time values in local dates. +#' #' @examplesIf is_dataRetrieval_user() #' #' \donttest{ diff --git a/R/read_waterdata_daily.R b/R/read_waterdata_daily.R index 0551e948..17fd51a8 100644 --- a/R/read_waterdata_daily.R +++ b/R/read_waterdata_daily.R @@ -10,14 +10,14 @@ #' @param statistic_id `r get_ogc_params("daily")$statistic_id` #' Multiple statistic_ids can be requested as a character vector. #' @param time `r get_ogc_params("daily")$time` -#' You can also use a vector of length 2: the first value being the starting date, -#' the second value being the ending date. NA's within the vector indicate a -#' half-bound date. For example, c("2024-01-01", NA) will return all data starting -#' at 2024-01-01. +#' +#' See also Details below for more information. #' @param value `r get_ogc_params("daily")$value` #' @param unit_of_measure `r get_ogc_params("daily")$unit_of_measure` #' @param approval_status `r get_ogc_params("daily")$approval_status` #' @param last_modified `r get_ogc_params("daily")$last_modified` +#' +#' See also Details below for more information. #' @param time_series_id `r get_ogc_params("daily")$time_series_id` #' Multiple time_series_ids can be requested as a character vector. #' @param qualifier `r get_ogc_params("daily")$qualifier` @@ -45,6 +45,9 @@ #' be requested from a native csv format. This can be dangerous because the #' data will cut off at 50,000 rows without indication that more data #' is available. Use `TRUE` with caution. +#' +#' @inherit read_waterdata_continuous details +#' #' @examplesIf is_dataRetrieval_user() #' #' \donttest{ @@ -82,7 +85,11 @@ #' #' dv_post <- read_waterdata_daily(monitoring_location_id = site, #' approval_status = c("Approved", "Provisional")) -#' +#' # Don't attach "request" attribute: +#' 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")) #' } read_waterdata_daily <- function(monitoring_location_id = NA_character_, parameter_code = NA_character_, diff --git a/R/read_waterdata_field_measurements.R b/R/read_waterdata_field_measurements.R index c382f561..21c6ce1c 100644 --- a/R/read_waterdata_field_measurements.R +++ b/R/read_waterdata_field_measurements.R @@ -9,14 +9,14 @@ #' Multiple parameter_codes can be requested as a character vector. #' @param observing_procedure_code `r get_ogc_params("field-measurements")$observing_procedure_code` #' @param time `r get_ogc_params("field-measurements")$time` -#' You can also use a vector of length 2: the first value being the starting date, -#' the second value being the ending date. NA's within the vector indicate a -#' half-bound date. For example, c("2024-01-01", NA) will return all data starting -#' at 2024-01-01. +#' +#' See also Details below for more information. #' @param value `r get_ogc_params("field-measurements")$value` #' @param unit_of_measure `r get_ogc_params("field-measurements")$unit_of_measure` #' @param approval_status `r get_ogc_params("field-measurements")$approval_status` #' @param last_modified `r get_ogc_params("field-measurements")$last_modified` +#' +#' See also Details below for more information. #' @param qualifier `r get_ogc_params("field-measurements")$qualifier` #' @param field_visit_id `r get_ogc_params("field-measurements")$field_visit_id` #' @param observing_procedure `r get_ogc_params("field-measurements")$observing_procedure` @@ -46,6 +46,10 @@ #' be requested from a native csv format. This can be dangerous because the #' data will cut off at 50,000 rows without indication that more data #' is available. Use `TRUE` with caution. +#' +#' @inherit read_waterdata_continuous details +#' +#' #' @examplesIf is_dataRetrieval_user() #' #' \donttest{ @@ -54,8 +58,11 @@ #' #' groundwater <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201") #' -#' gwl_data <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201", -#' parameter_code = "72019", +#' gwl_data <- read_waterdata_field_measurements(monitoring_location_id = "USGS-02238500", +#' parameter_code = "00060", +#' time = as.POSIXct(c("2024-02-26 15:00:00", +#' "2025-08-27 12:00:00"), +#' tz = "America/Chicago"), #' skipGeometry = TRUE) #' #' gwl_data_period <- read_waterdata_field_measurements( diff --git a/R/read_waterdata_latest_continuous.R b/R/read_waterdata_latest_continuous.R index c7b96424..9a5f818e 100644 --- a/R/read_waterdata_latest_continuous.R +++ b/R/read_waterdata_latest_continuous.R @@ -8,14 +8,14 @@ #' @param parameter_code `r get_ogc_params("latest-continuous")$parameter_code` #' Multiple parameter_codes can be requested as a character vector. #' @param time `r get_ogc_params("latest-continuous")$time` -#' You can also use a vector of length 2: the first value being the starting date, -#' the second value being the ending date. NA's within the vector indicate a -#' half-bound date. For example, c("2024-01-01", NA) will return all data starting -#' at 2024-01-01. +#' +#' See also Details below for more information. #' @param value `r get_ogc_params("latest-continuous")$value` #' @param unit_of_measure `r get_ogc_params("latest-continuous")$unit_of_measure` #' @param approval_status `r get_ogc_params("latest-continuous")$approval_status` #' @param last_modified `r get_ogc_params("latest-continuous")$last_modified` +#' +#' See also Details below for more information. #' @param time_series_id `r get_ogc_params("latest-continuous")$time_series_id` #' Multiple time_series_ids can be requested as a character vector. #' @param qualifier `r get_ogc_params("latest-continuous")$qualifier` @@ -43,6 +43,8 @@ #' be requested from a native csv format. This can be dangerous because the #' data will cut off at 50,000 rows without indication that more data #' is available. Use `TRUE` with caution. +#' +#' @inherit read_waterdata_continuous details #' @examplesIf is_dataRetrieval_user() #' #' \donttest{ diff --git a/R/read_waterdata_latest_daily.R b/R/read_waterdata_latest_daily.R index 1c44addc..0afba2d5 100644 --- a/R/read_waterdata_latest_daily.R +++ b/R/read_waterdata_latest_daily.R @@ -10,14 +10,14 @@ #' @param statistic_id `r get_ogc_params("latest-daily")$statistic_id` #' Multiple statistic_ids can be requested as a character vector. #' @param time `r get_ogc_params("latest-daily")$time` -#' You can also use a vector of length 2: the first value being the starting date, -#' the second value being the ending date. NA's within the vector indicate a -#' half-bound date. For example, c("2024-01-01", NA) will return all data starting -#' at 2024-01-01. +#' +#' See also Details below for more information. #' @param value `r get_ogc_params("latest-daily")$value` #' @param unit_of_measure `r get_ogc_params("latest-daily")$unit_of_measure` #' @param approval_status `r get_ogc_params("latest-daily")$approval_status` #' @param last_modified `r get_ogc_params("latest-daily")$last_modified` +#' +#' See also Details below for more information. #' @param time_series_id `r get_ogc_params("latest-daily")$time_series_id` #' Multiple time_series_ids can be requested as a character vector. #' @param qualifier `r get_ogc_params("latest-daily")$qualifier` @@ -45,6 +45,9 @@ #' be requested from a native csv format. This can be dangerous because the #' data will cut off at 50,000 rows without indication that more data #' is available. Use `TRUE` with caution. +#' +#' @inherit read_waterdata_continuous details +#' #' @examplesIf is_dataRetrieval_user() #' #' \donttest{ diff --git a/R/read_waterdata_ts_meta.R b/R/read_waterdata_ts_meta.R index 38ed8278..4965c4e1 100644 --- a/R/read_waterdata_ts_meta.R +++ b/R/read_waterdata_ts_meta.R @@ -16,8 +16,14 @@ #' Multiple computation_period_identifiers can be requested as a character vector. #' @param sublocation_identifier `r get_ogc_params("time-series-metadata")$sublocation_identifier` #' @param last_modified `r get_ogc_params("time-series-metadata")$last_modified` +#' +#' See also Details below for more information. #' @param begin_utc `r get_ogc_params("time-series-metadata")$begin_utc` +#' #' +#' See also Details below for more information. #' @param end_utc `r get_ogc_params("time-series-metadata")$end_utc` +#' +#' See also Details below for more information. #' @param hydrologic_unit_code `r get_ogc_params("time-series-metadata")$hydrologic_unit_code` #' @param state_name `r get_ogc_params("time-series-metadata")$state_name` #' @param thresholds `r get_ogc_params("time-series-metadata")$thresholds` @@ -54,6 +60,9 @@ #' be requested from a native csv format. This can be dangerous because the #' data will cut off at 50,000 rows without indication that more data #' is available. Use `TRUE` with caution. +#' +#' @inherit read_waterdata_continuous details +#' #' @examplesIf is_dataRetrieval_user() #' #' \donttest{ diff --git a/R/walk_pages.R b/R/walk_pages.R index bedf72da..ae817064 100644 --- a/R/walk_pages.R +++ b/R/walk_pages.R @@ -106,7 +106,7 @@ get_csv <- function(req, limit){ if(httr2::resp_has_body(resp)){ return_list <- httr2::resp_body_string(resp) - df <- suppressMessages(readr::read_csv(file = return_list)) + df <- data.table::fread(input = return_list, data.table = FALSE) if(skip_geo){ df <- df[, names(df)[!names(df) %in% c("x", "y")]] } else { diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index d4c5f25e..d0cd4d70 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -56,7 +56,9 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{last_modified} that intersects the value of datetime are selected.} +Only features that have a \code{last_modified} that intersects the value of datetime are selected. + +See also Details below for more information.} \item{time}{The date an observation represents. You can query this field using date-times or intervals, adhering to RFC 3339, or using ISO 8601 duration objects. Intervals may be bounded or half-bounded (double-dots at start or end). Examples: @@ -68,11 +70,8 @@ Examples: } Only features that have a \code{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. -. -You can also use a vector of length 2: the first value being the starting date, -the second value being the ending date. NA's within the vector indicate a -half-bound date. For example, c("2024-01-01", NA) will return all data starting -at 2024-01-01.} + +See also Details below for more information.} \item{limit}{The optional limit parameter is used to control the subset of the selected features that should be returned in each page. The maximum allowable @@ -101,6 +100,22 @@ in 2026. Geometry output is not supported in the continuous data API endpoint. } +\details{ +You can also use a vector of length 2 for any time queries (such as time +or last_modified). The first value is the starting date (or datetime), +the second value is the ending date(or datetime). +NA's within the vector indicate a half-bound date. +For example, \code{time = c("2024-01-01", NA)} will return all data starting +at 2024-01-01. +\code{time = c(NA, "2024-01-01")} will return all data from the beginning of +the timeseries until 2024-01-01. +By default, time is assumed UTC, although time zone attributes +will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", +"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +noon and 2pm eastern time on 2021-01-01. +All time values RETURNED from the service are UTC with the exception of +daily data, which returns time values in local dates. +} \examples{ \dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} diff --git a/man/read_waterdata_daily.Rd b/man/read_waterdata_daily.Rd index 44522f35..26e3d192 100644 --- a/man/read_waterdata_daily.Rd +++ b/man/read_waterdata_daily.Rd @@ -63,7 +63,9 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{last_modified} that intersects the value of datetime are selected.} +Only features that have a \code{last_modified} that intersects the value of datetime are selected. + +See also Details below for more information.} \item{skipGeometry}{This option can be used to skip response geometries for each feature. The returning object will be a data frame with no spatial @@ -80,10 +82,7 @@ Examples: Only features that have a \code{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. -You can also use a vector of length 2: the first value being the starting date, -the second value being the ending date. NA's within the vector indicate a -half-bound date. For example, c("2024-01-01", NA) will return all data starting -at 2024-01-01.} +See also Details below for more information.} \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 @@ -109,6 +108,22 @@ is available. Use \code{TRUE} with caution.} \description{ Daily data provide one data value to represent water conditions for the day. Throughout much of the history of the USGS, the primary water data available was daily data collected manually at the monitoring location once each day. With improved availability of computer storage and automated transmission of data, the daily data published today are generally a statistical summary or metric of the continuous data collected each day, such as the daily mean, minimum, or maximum value. Daily data are automatically calculated from the continuous data of the same parameter code and are described by parameter code and a statistic code. These data have also been referred to as “daily values” or “DV”. } +\details{ +You can also use a vector of length 2 for any time queries (such as time +or last_modified). The first value is the starting date (or datetime), +the second value is the ending date(or datetime). +NA's within the vector indicate a half-bound date. +For example, \code{time = c("2024-01-01", NA)} will return all data starting +at 2024-01-01. +\code{time = c(NA, "2024-01-01")} will return all data from the beginning of +the timeseries until 2024-01-01. +By default, time is assumed UTC, although time zone attributes +will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", +"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +noon and 2pm eastern time on 2021-01-01. +All time values RETURNED from the service are UTC with the exception of +daily data, which returns time values in local dates. +} \examples{ \dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} @@ -147,7 +162,11 @@ dv_data_quick <- read_waterdata_daily(monitoring_location_id = site, dv_post <- read_waterdata_daily(monitoring_location_id = site, approval_status = c("Approved", "Provisional")) - +# Don't attach "request" attribute: +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")) } \dontshow{\}) # examplesIf} } diff --git a/man/read_waterdata_field_measurements.Rd b/man/read_waterdata_field_measurements.Rd index cec758b0..b4b80d83 100644 --- a/man/read_waterdata_field_measurements.Rd +++ b/man/read_waterdata_field_measurements.Rd @@ -62,7 +62,9 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{last_modified} that intersects the value of datetime are selected.} +Only features that have a \code{last_modified} that intersects the value of datetime are selected. + +See also Details below for more information.} \item{observing_procedure}{Water measurement or water-quality observing procedure descriptions.} @@ -85,10 +87,7 @@ Examples: Only features that have a \code{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. -You can also use a vector of length 2: the first value being the starting date, -the second value being the ending date. NA's within the vector indicate a -half-bound date. For example, c("2024-01-01", NA) will return all data starting -at 2024-01-01.} +See also Details below for more information.} \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 @@ -114,6 +113,22 @@ is available. Use \code{TRUE} with caution.} \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. } +\details{ +You can also use a vector of length 2 for any time queries (such as time +or last_modified). The first value is the starting date (or datetime), +the second value is the ending date(or datetime). +NA's within the vector indicate a half-bound date. +For example, \code{time = c("2024-01-01", NA)} will return all data starting +at 2024-01-01. +\code{time = c(NA, "2024-01-01")} will return all data from the beginning of +the timeseries until 2024-01-01. +By default, time is assumed UTC, although time zone attributes +will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", +"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +noon and 2pm eastern time on 2021-01-01. +All time values RETURNED from the service are UTC with the exception of +daily data, which returns time values in local dates. +} \examples{ \dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} @@ -123,8 +138,11 @@ field_data_sf <- read_waterdata_field_measurements(monitoring_location_id = site groundwater <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201") -gwl_data <- read_waterdata_field_measurements(monitoring_location_id = "USGS-375907091432201", - parameter_code = "72019", +gwl_data <- read_waterdata_field_measurements(monitoring_location_id = "USGS-02238500", + parameter_code = "00060", + time = as.POSIXct(c("2024-02-26 15:00:00", + "2025-08-27 12:00:00"), + tz = "America/Chicago"), skipGeometry = TRUE) gwl_data_period <- read_waterdata_field_measurements( diff --git a/man/read_waterdata_latest_continuous.Rd b/man/read_waterdata_latest_continuous.Rd index 8fea80e7..482f6750 100644 --- a/man/read_waterdata_latest_continuous.Rd +++ b/man/read_waterdata_latest_continuous.Rd @@ -58,7 +58,9 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{last_modified} that intersects the value of datetime are selected.} +Only features that have a \code{last_modified} that intersects the value of datetime are selected. + +See also Details below for more information.} \item{skipGeometry}{This option can be used to skip response geometries for each feature. The returning object will be a data frame with no spatial @@ -75,10 +77,7 @@ Examples: Only features that have a \code{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. -You can also use a vector of length 2: the first value being the starting date, -the second value being the ending date. NA's within the vector indicate a -half-bound date. For example, c("2024-01-01", NA) will return all data starting -at 2024-01-01.} +See also Details below for more information.} \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 @@ -104,6 +103,22 @@ is available. Use \code{TRUE} with caution.} \description{ This endpoint provides the most recent observation for each time series of continuous data. Continuous data are collected via automated sensors installed at a monitoring location. They are collected at a high frequency and often at a fixed 15-minute interval. Depending on the specific monitoring location, the data may be transmitted automatically via telemetry and be available on WDFN within minutes of collection, while other times the delivery of data may be delayed if the monitoring location does not have the capacity to automatically transmit data. Continuous data are described by parameter name and parameter code. These data might also be referred to as "instantaneous values" or "IV" } +\details{ +You can also use a vector of length 2 for any time queries (such as time +or last_modified). The first value is the starting date (or datetime), +the second value is the ending date(or datetime). +NA's within the vector indicate a half-bound date. +For example, \code{time = c("2024-01-01", NA)} will return all data starting +at 2024-01-01. +\code{time = c(NA, "2024-01-01")} will return all data from the beginning of +the timeseries until 2024-01-01. +By default, time is assumed UTC, although time zone attributes +will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", +"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +noon and 2pm eastern time on 2021-01-01. +All time values RETURNED from the service are UTC with the exception of +daily data, which returns time values in local dates. +} \examples{ \dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} diff --git a/man/read_waterdata_latest_daily.Rd b/man/read_waterdata_latest_daily.Rd index d6fc4e98..7479e3f4 100644 --- a/man/read_waterdata_latest_daily.Rd +++ b/man/read_waterdata_latest_daily.Rd @@ -63,7 +63,9 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{last_modified} that intersects the value of datetime are selected.} +Only features that have a \code{last_modified} that intersects the value of datetime are selected. + +See also Details below for more information.} \item{skipGeometry}{This option can be used to skip response geometries for each feature. The returning object will be a data frame with no spatial @@ -80,10 +82,7 @@ Examples: Only features that have a \code{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. -You can also use a vector of length 2: the first value being the starting date, -the second value being the ending date. NA's within the vector indicate a -half-bound date. For example, c("2024-01-01", NA) will return all data starting -at 2024-01-01.} +See also Details below for more information.} \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 @@ -109,6 +108,22 @@ is available. Use \code{TRUE} with caution.} \description{ Daily data provide one data value to represent water conditions for the day. Throughout much of the history of the USGS, the primary water data available was daily data collected manually at the monitoring location once each day. With improved availability of computer storage and automated transmission of data, the daily data published today are generally a statistical summary or metric of the continuous data collected each day, such as the daily mean, minimum, or maximum value. Daily data are automatically calculated from the continuous data of the same parameter code and are described by parameter code and a statistic code. These data have also been referred to as “daily values” or “DV”. } +\details{ +You can also use a vector of length 2 for any time queries (such as time +or last_modified). The first value is the starting date (or datetime), +the second value is the ending date(or datetime). +NA's within the vector indicate a half-bound date. +For example, \code{time = c("2024-01-01", NA)} will return all data starting +at 2024-01-01. +\code{time = c(NA, "2024-01-01")} will return all data from the beginning of +the timeseries until 2024-01-01. +By default, time is assumed UTC, although time zone attributes +will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", +"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +noon and 2pm eastern time on 2021-01-01. +All time values RETURNED from the service are UTC with the exception of +daily data, which returns time values in local dates. +} \examples{ \dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} diff --git a/man/read_waterdata_ts_meta.Rd b/man/read_waterdata_ts_meta.Rd index 088f1b8a..84771fc9 100644 --- a/man/read_waterdata_ts_meta.Rd +++ b/man/read_waterdata_ts_meta.Rd @@ -64,7 +64,9 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{last_modified} that intersects the value of datetime are selected.} +Only features that have a \code{last_modified} that intersects the value of datetime are selected. + +See also Details below for more information.} \item{begin_utc}{The datetime of the earliest observation in the time series. Together with \code{end}, this field represents the period of record of a time series. Note that some time series may have large gaps in their collection record. You can query this field using date-times or intervals, adhering to RFC 3339, or using ISO 8601 duration objects. Intervals may be bounded or half-bounded (double-dots at start or end). @@ -76,7 +78,10 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{begin} that intersects the value of datetime are selected.} +Only features that have a \code{begin} that intersects the value of datetime are selected. + +#' +See also Details below for more information.} \item{end_utc}{The datetime of the most recent observation in the time series. Data returned by this endpoint updates at most once per day, and potentially less frequently than that, and as such there may be more recent observations within a time series than the time series \code{end} value reflects. Together with \code{begin}, this field represents the period of record of a time series. It is additionally used to determine whether a time series is "active". You can query this field using date-times or intervals, adhering to RFC 3339, or using ISO 8601 duration objects. Intervals may be bounded or half-bounded (double-dots at start or end). @@ -88,7 +93,9 @@ Examples: \item Duration objects: "P1M" for data from the past month or "PT36H" for the last 36 hours } -Only features that have a \code{end} that intersects the value of datetime are selected.} +Only features that have a \code{end} that intersects the value of datetime are selected. + +See also Details below for more information.} \item{hydrologic_unit_code}{The United States is divided and sub-divided into successively smaller hydrologic units which are classified into four levels: regions, sub-regions, accounting units, and cataloging units. The hydrologic units are arranged within each other, from the smallest (cataloging units) to the largest (regions). Each hydrologic unit is identified by a unique hydrologic unit code (HUC) consisting of two to eight digits based on the four levels of classification in the hydrologic unit system.} @@ -149,6 +156,22 @@ is available. Use \code{TRUE} with caution.} \description{ Daily data and continuous measurements are grouped into time series, which represent a collection of observations of a single parameter, potentially aggregated using a standard statistic, at a single monitoring location. This endpoint provides metadata about those time series, including their operational thresholds, units of measurement, and when the earliest and most recent observations in a time series occurred. } +\details{ +You can also use a vector of length 2 for any time queries (such as time +or last_modified). The first value is the starting date (or datetime), +the second value is the ending date(or datetime). +NA's within the vector indicate a half-bound date. +For example, \code{time = c("2024-01-01", NA)} will return all data starting +at 2024-01-01. +\code{time = c(NA, "2024-01-01")} will return all data from the beginning of +the timeseries until 2024-01-01. +By default, time is assumed UTC, although time zone attributes +will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", +"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +noon and 2pm eastern time on 2021-01-01. +All time values RETURNED from the service are UTC with the exception of +daily data, which returns time values in local dates. +} \examples{ \dontshow{if (is_dataRetrieval_user()) withAutoprint(\{ # examplesIf} From 0963952a58c4d6334bd7cbb4988e53ea4b82bf83 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Tue, 10 Feb 2026 12:31:56 -0600 Subject: [PATCH 18/19] bump version? --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 290f2bf2..abbd7aa2 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -34,7 +34,7 @@ jobs: - uses: r-lib/actions/setup-pandoc@6012817847b5f064d0882d67a7b5e2ca6639afb2 - - uses: r-lib/actions/setup-r@473c68190595b311a74f208fba61a8d8c0d4c247 + - uses: r-lib/actions/setup-r@cdfe59f7d9ed0bc33451d5e5d5d9dde04246fa59 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} From 9515c0bae19fa72c810b61b0ce89a82c16a230f7 Mon Sep 17 00:00:00 2001 From: Laura DeCicco Date: Tue, 10 Feb 2026 14:42:21 -0600 Subject: [PATCH 19/19] typo --- NEWS | 2 +- R/read_waterdata_continuous.R | 2 +- man/read_waterdata_continuous.Rd | 2 +- man/read_waterdata_daily.Rd | 2 +- man/read_waterdata_field_measurements.Rd | 2 +- man/read_waterdata_latest_continuous.Rd | 2 +- man/read_waterdata_latest_daily.Rd | 2 +- man/read_waterdata_ts_meta.Rd | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index b40fa0e6..ffb00b06 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,7 @@ dataRetrieval 2.7.22.9000 * Updated vignettes, examples, and README to reflect new stats functions. * Added tests for read_waterdata_stats functions * Updated next_req_url to allow paging through /statistics API output -* Added deprecate message to readNWISstat function +* Added deprecation message to readNWISstat function * Specify "UTC" attribute for returned time * Added options("dataRetrieval.attach_request" = TRUE) as default to attach the request object as an attribute to the returned data frames. Setting diff --git a/R/read_waterdata_continuous.R b/R/read_waterdata_continuous.R index 89dfc11d..7ddd315c 100644 --- a/R/read_waterdata_continuous.R +++ b/R/read_waterdata_continuous.R @@ -56,7 +56,7 @@ #' the timeseries until 2024-01-01. #' By default, time is assumed UTC, although time zone attributes #' will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", -#' "2021-01-01 12:00"), tz = "America/New_York")} will request data that between +#' "2021-01-01 14:00"), tz = "America/New_York")} will request data that between #' noon and 2pm eastern time on 2021-01-01. #' All time values RETURNED from the service are UTC with the exception of #' daily data, which returns time values in local dates. diff --git a/man/read_waterdata_continuous.Rd b/man/read_waterdata_continuous.Rd index d0cd4d70..4b28c37f 100644 --- a/man/read_waterdata_continuous.Rd +++ b/man/read_waterdata_continuous.Rd @@ -111,7 +111,7 @@ at 2024-01-01. the timeseries until 2024-01-01. By default, time is assumed UTC, although time zone attributes will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", -"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +"2021-01-01 14:00"), tz = "America/New_York")} will request data that between noon and 2pm eastern time on 2021-01-01. All time values RETURNED from the service are UTC with the exception of daily data, which returns time values in local dates. diff --git a/man/read_waterdata_daily.Rd b/man/read_waterdata_daily.Rd index 26e3d192..28071bd7 100644 --- a/man/read_waterdata_daily.Rd +++ b/man/read_waterdata_daily.Rd @@ -119,7 +119,7 @@ at 2024-01-01. the timeseries until 2024-01-01. By default, time is assumed UTC, although time zone attributes will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", -"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +"2021-01-01 14:00"), tz = "America/New_York")} will request data that between noon and 2pm eastern time on 2021-01-01. All time values RETURNED from the service are UTC with the exception of daily data, which returns time values in local dates. diff --git a/man/read_waterdata_field_measurements.Rd b/man/read_waterdata_field_measurements.Rd index b4b80d83..8dfbbf26 100644 --- a/man/read_waterdata_field_measurements.Rd +++ b/man/read_waterdata_field_measurements.Rd @@ -124,7 +124,7 @@ at 2024-01-01. the timeseries until 2024-01-01. By default, time is assumed UTC, although time zone attributes will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", -"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +"2021-01-01 14:00"), tz = "America/New_York")} will request data that between noon and 2pm eastern time on 2021-01-01. All time values RETURNED from the service are UTC with the exception of daily data, which returns time values in local dates. diff --git a/man/read_waterdata_latest_continuous.Rd b/man/read_waterdata_latest_continuous.Rd index 482f6750..a1601603 100644 --- a/man/read_waterdata_latest_continuous.Rd +++ b/man/read_waterdata_latest_continuous.Rd @@ -114,7 +114,7 @@ at 2024-01-01. the timeseries until 2024-01-01. By default, time is assumed UTC, although time zone attributes will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", -"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +"2021-01-01 14:00"), tz = "America/New_York")} will request data that between noon and 2pm eastern time on 2021-01-01. All time values RETURNED from the service are UTC with the exception of daily data, which returns time values in local dates. diff --git a/man/read_waterdata_latest_daily.Rd b/man/read_waterdata_latest_daily.Rd index 7479e3f4..73183d3b 100644 --- a/man/read_waterdata_latest_daily.Rd +++ b/man/read_waterdata_latest_daily.Rd @@ -119,7 +119,7 @@ at 2024-01-01. the timeseries until 2024-01-01. By default, time is assumed UTC, although time zone attributes will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", -"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +"2021-01-01 14:00"), tz = "America/New_York")} will request data that between noon and 2pm eastern time on 2021-01-01. All time values RETURNED from the service are UTC with the exception of daily data, which returns time values in local dates. diff --git a/man/read_waterdata_ts_meta.Rd b/man/read_waterdata_ts_meta.Rd index 84771fc9..984e3166 100644 --- a/man/read_waterdata_ts_meta.Rd +++ b/man/read_waterdata_ts_meta.Rd @@ -167,7 +167,7 @@ at 2024-01-01. the timeseries until 2024-01-01. By default, time is assumed UTC, although time zone attributes will be accommodated. As an example, setting \code{time = as.POSIXct(c("2021-01-01 12:00:00", -"2021-01-01 12:00"), tz = "America/New_York")} will request data that between +"2021-01-01 14:00"), tz = "America/New_York")} will request data that between noon and 2pm eastern time on 2021-01-01. All time values RETURNED from the service are UTC with the exception of daily data, which returns time values in local dates.