From 1378d0740896e4180b7f3d9d853ccd4c7478eda5 Mon Sep 17 00:00:00 2001 From: unknown <ldecicco@usgs.gov> Date: Wed, 31 Dec 2014 13:50:05 -0600 Subject: [PATCH] Took out qwdata option for readNWISdata function. That would need to be sent to waterdata instead of waterservices. --- R/readNWISdata.r | 7 ++++++- man/readNWISdata.Rd | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/R/readNWISdata.r b/R/readNWISdata.r index 8b54a4cf..7b27bcb1 100644 --- a/R/readNWISdata.r +++ b/R/readNWISdata.r @@ -4,7 +4,7 @@ #' Arguments to the function should be based on \url{http://waterservices.usgs.gov} service calls. #' #' @param service string. Possible values are "iv" (for instantaneous), "dv" (for daily values), "gwlevels" -#' (for groundwater levels), and "qwdata" (for water quality) +#' (for groundwater levels) #' @param \dots see \url{http://waterservices.usgs.gov/rest/Site-Service.html#Service} for a complete list of options #' @keywords data import NWIS web service #' @return A data frame with the following columns: @@ -50,12 +50,17 @@ readNWISdata <- function(service="dv", ...){ matchReturn <- list(...) + match.arg(service, c("dv","iv","gwlevels")) + if(length(service) > 1){ stop("Only one service call allowed.") } values <- sapply(matchReturn, function(x) URLencode(as.character(paste(eval(x),collapse=",",sep="")))) + names(values)[names(values) == "startDate"] <- "startDT" + names(values)[names(values) == "endDate"] <- "endDT" + urlCall <- paste(paste(names(values),values,sep="="),collapse="&") if(service %in% c("dv","iv","gwlevels")){ diff --git a/man/readNWISdata.Rd b/man/readNWISdata.Rd index 698a393b..1dd9353b 100644 --- a/man/readNWISdata.Rd +++ b/man/readNWISdata.Rd @@ -8,7 +8,7 @@ readNWISdata(service = "dv", ...) } \arguments{ \item{service}{string. Possible values are "iv" (for instantaneous), "dv" (for daily values), "gwlevels" -(for groundwater levels), and "qwdata" (for water quality)} +(for groundwater levels)} \item{\dots}{see \url{http://waterservices.usgs.gov/rest/Site-Service.html#Service} for a complete list of options} } -- GitLab