From b3b7e9046f2b2fe76f3543c1d73d0cd76239fac0 Mon Sep 17 00:00:00 2001 From: unknown <ldecicco@usgs.gov> Date: Tue, 2 Dec 2014 09:00:55 -0600 Subject: [PATCH] Updating start/end help text. --- R/constructNWISURL.r | 14 +++++++++----- R/readNWISdv.r | 6 ++++-- R/readNWISqw.r | 22 +++++++++++----------- R/readNWISunit.r | 38 ++++++++++++++++++++++++++------------ R/readWQPqw.r | 17 +++++++++++------ man/constructNWISURL.Rd | 6 ++++-- man/constructWQPURL.Rd | 6 ++++-- man/readNWISdv.Rd | 6 ++++-- man/readNWISgwl.Rd | 14 ++++++++++---- man/readNWISmeas.Rd | 6 ++++-- man/readNWISpeak.Rd | 6 ++++-- man/readNWISqw.Rd | 20 ++++++++++---------- man/readNWISuv.Rd | 9 ++++++--- man/readWQPqw.Rd | 13 ++++++++----- 14 files changed, 115 insertions(+), 68 deletions(-) diff --git a/R/constructNWISURL.r b/R/constructNWISURL.r index 0294adb8..36508f02 100644 --- a/R/constructNWISURL.r +++ b/R/constructNWISURL.r @@ -6,8 +6,10 @@ #' #' @param siteNumber string or vector of strings USGS site number. This is usually an 8 digit number #' @param parameterCd string or vector of USGS parameter code. This is usually an 5 digit number. -#' @param startDate string starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate string ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @param statCd string or vector USGS statistic code only used for daily value service. This is usually 5 digits. Daily mean (00003) is the default. #' @param service string USGS service to call. Possible values are "dv" (daily values), "uv" (unit/instantaneous values), #' "qw" (water quality data), "gwlevels" (groundwater),and "rating" (rating curve), "peak", "meas" (discrete streamflow measurements). @@ -224,8 +226,10 @@ constructNWISURL <- function(siteNumber,parameterCd="00060",startDate="",endDate #' #' @param siteNumber string or vector of strings USGS site number. This is usually an 8 digit number #' @param parameterCd string or vector of USGS parameter code. This is usually an 5 digit number. -#' @param startDate string starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate string ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @keywords data import WQP web service #' @return url string #' @export @@ -242,7 +246,7 @@ constructWQPURL <- function(siteNumber,parameterCd,startDate,endDate){ multipleSites <- length(siteNumber) > 1 multiplePcodes <- length(parameterCd)>1 - siteNumber <- paste(siteNumber, collapse=",") + siteNumber <- paste(siteNumber, collapse=";") if(all(nchar(parameterCd) == 5)){ suppressWarnings(pCodeLogic <- all(!is.na(as.numeric(parameterCd)))) diff --git a/R/readNWISdv.r b/R/readNWISdv.r index 883682c4..00f50eeb 100644 --- a/R/readNWISdv.r +++ b/R/readNWISdv.r @@ -6,8 +6,10 @@ #' #' @param siteNumber character USGS site number. This is usually an 8 digit number. Multiple sites can be requested with a character vector. #' @param parameterCd character of USGS parameter code(s). This is usually an 5 digit number. -#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @param statCd character USGS statistic code. This is usually 5 digits. Daily mean (00003) is the default. #' @return A data frame with the following columns: #' \tabular{lll}{ diff --git a/R/readNWISqw.r b/R/readNWISqw.r index a743b992..b8647581 100644 --- a/R/readNWISqw.r +++ b/R/readNWISqw.r @@ -4,10 +4,12 @@ #' A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} #' A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table} #' -#' @param siteNumber character of USGS site numbers. This is usually an 8 digit number +#' @param siteNumbers character of USGS site numbers. This is usually an 8 digit number #' @param pCodes character of USGS parameter code(s). This is usually an 5 digit number. -#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @param expanded logical defaults to TRUE. If TRUE, retrieves additional information. Expanded data includes #' remark_cd (remark code), result_va (result value), val_qual_tx (result value qualifier code), meth_cd (method code), #' dqi_cd (data-quality indicator code), rpt_lev_va (reporting level), and rpt_lev_cd (reporting level type). @@ -41,21 +43,19 @@ #' @seealso \code{\link{readWQPdata}}, \code{\link{whatWQPsites}}, #' \code{\link{readWQPqw}}, \code{\link{constructNWISURL}} #' @examples -#' siteNumber <- c('04024430','04024000') +#' siteNumbers <- c('04024430','04024000') #' startDate <- '2010-01-01' #' endDate <- '' #' pCodes <- c('34247','30234','32104','34220') #' -#' rawNWISqwData <- readNWISqw(siteNumber,pCodes,startDate,endDate) -#' rawNWISqwDataExpandReshaped <- readNWISqw(siteNumber,pCodes, -#' startDate,endDate,expanded=TRUE) -#' rawNWISqwDataExpand <- readNWISqw(siteNumber,pCodes, -#' startDate,endDate,expanded=TRUE,reshape=FALSE) +#' rawNWISqwData <- readNWISqw(siteNumbers,pCodes,startDate,endDate) +#' rawNWISqwDataReshaped <- readNWISqw(siteNumbers,pCodes, +#' startDate,endDate,reshape=TRUE) #' -readNWISqw <- function (siteNumber,pCodes,startDate="",endDate="", +readNWISqw <- function (siteNumbers,pCodes,startDate="",endDate="", expanded=TRUE,reshape=FALSE,tz=""){ - url <- constructNWISURL(siteNumber,pCodes,startDate,endDate,"qw",expanded=expanded) + url <- constructNWISURL(siteNumbers,pCodes,startDate,endDate,"qw",expanded=expanded) data <- importRDB1(url,asDateTime=TRUE, qw=TRUE, tz = tz) originalHeader <- comment(data) diff --git a/R/readNWISunit.r b/R/readNWISunit.r index 0a1a274b..da96b489 100644 --- a/R/readNWISunit.r +++ b/R/readNWISunit.r @@ -2,12 +2,15 @@ #' #' Imports data from NWIS web service. This function gets the data from here: \url{http://waterservices.usgs.gov/} #' A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} -#' A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table} +#' A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table}. +#' More information on the web service can be found here: \url{http://waterservices.usgs.gov/rest/IV-Service.html}. #' #' @param siteNumbers character USGS site number (or multiple sites). This is usually an 8 digit number #' @param parameterCd character USGS parameter code. This is usually an 5 digit number. -#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @param tz character to set timezone attribute of dateTime. Default is an empty quote, which converts the #' dateTimes to UTC (properly accounting for daylight savings times based on the data's provided tz_cd column). #' Possible values to provide are "America/New_York","America/Chicago", "America/Denver","America/Los_Angeles", @@ -66,8 +69,10 @@ readNWISuv <- function (siteNumbers,parameterCd,startDate="",endDate="", tz=""){ #' #' #' @param siteNumber character USGS site number. This is usually an 8 digit number -#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @return A data frame with the following columns: #' \tabular{lll}{ #' Name \tab Type \tab Description \cr @@ -158,8 +163,10 @@ readNWISrating <- function (siteNumber,type="base"){ #' #' #' @param siteNumber character USGS site number. This is usually an 8 digit number -#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @param tz character to set timezone attribute of dateTime. Default is an empty quote, which converts the #' dateTimes to UTC (properly accounting for daylight savings times based on the data's provided tz_cd column). #' Possible values to provide are "America/New_York","America/Chicago", "America/Denver","America/Los_Angeles", @@ -210,18 +217,24 @@ readNWISmeas <- function (siteNumber,startDate="",endDate="", tz=""){ #' #' Reads groundwater level measurements from NWISweb. Mixed date/times come back from the service #' depending on the year that the data was collected. See \url{http://waterdata.usgs.gov/usa/nwis/gw} -#' for details about groundwater -#' +#' for details about groundwater. Groundwater dates and times are returned in many different formats, therefore the +#' date/time information is returned as a character string. Users will need to convert to a date object. +#' See \url{http://waterservices.usgs.gov/rest/GW-Levels-Service.html} for more information. +#' #' @param siteNumbers character USGS site number (or multiple sites). This is usually an 8 digit number -#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @return A data frame with the following columns: #' \tabular{lll}{ #' Name \tab Type \tab Description \cr #' agency_cd \tab character \tab The NWIS code for the agency reporting the data\cr #' site_no \tab character \tab The USGS site number \cr #' dateTime \tab character \tab The date and time of the value as a character \cr -#' tz_cd \tab character \tab The time zone code for dateTime \cr +#' dateTimeAccuracyCd \tab character \tab Information on the date/time accuracy \cr +#' censorCode \tab character \tab Censoring information \cr +#' sourceCode \tab character \tab Information on source of the data \cr #' code \tab character \tab Any codes that qualify the corresponding value\cr #' value \tab numeric \tab The numeric value for the parameter \cr #' } @@ -252,6 +265,7 @@ readNWISgwl <- function (siteNumbers,startDate="",endDate=""){ url <- constructNWISURL(siteNumbers,NA,startDate,endDate,"gwlevels",format="wml1") data <- importWaterML1(url,asDateTime=FALSE) + data$tz_cd <- NULL return (data) } diff --git a/R/readWQPqw.r b/R/readWQPqw.r index c8eba436..f53c5390 100644 --- a/R/readWQPqw.r +++ b/R/readWQPqw.r @@ -10,8 +10,10 @@ #' @param siteNumber character site number. This needs to include the full agency code prefix. #' @param parameterCd vector of USGS 5-digit parameter code or characteristicNames. #' Leaving this blank will return all of the measured values during the specified time period. -#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. -#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. +#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the earliest possible record. +#' @param endDate character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +#' retrieval for the latest possible record. #' @keywords data import USGS web service #' @return retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for #' start and end times. @@ -23,10 +25,11 @@ #' \dontrun{ #' rawPcode <- readWQPqw('USGS-01594440','01075', '', '') #' rawCharacteristicName <- readWQPqw('WIDNR_WQX-10032762','Specific conductance', '', '') +#' rawSites <- readWQPqw(c('USGS-01594440', 'USGS-01594440'), '01075','','') #' } -readWQPqw <- function(siteNumber,parameterCd,startDate="",endDate=""){ +readWQPqw <- function(siteNumbers,parameterCd,startDate="",endDate=""){ - url <- constructWQPURL(siteNumber,parameterCd,startDate,endDate) + url <- constructWQPURL(siteNumbers,parameterCd,startDate,endDate) retval <- importWQP(url) pcodeCheck <- all(nchar(parameterCd) == 5) & all(!is.na(suppressWarnings(as.numeric(parameterCd)))) @@ -40,9 +43,11 @@ readWQPqw <- function(siteNumber,parameterCd,startDate="",endDate=""){ } if(pcodeCheck){ - siteInfo <- whatWQPsites(siteid=siteNumber, pCode=parameterCd, startDateLo=startDate, startDateHi=endDate) + siteInfo <- whatWQPsites(siteid=paste0(siteNumbers,";"), + pCode=parameterCd, startDateLo=startDate, startDateHi=endDate) } else { - siteInfo <- whatWQPsites(siteid=siteNumber, characteristicName=parameterCd, startDateLo=startDate, startDateHi=endDate) + siteInfo <- whatWQPsites(siteid=paste0(siteNumbers,";"), + characteristicName=parameterCd, startDateLo=startDate, startDateHi=endDate) } siteInfoCommon <- data.frame(station_nm=siteInfo$MonitoringLocationName, diff --git a/man/constructNWISURL.Rd b/man/constructNWISURL.Rd index aa476f3a..8f39fcb7 100644 --- a/man/constructNWISURL.Rd +++ b/man/constructNWISURL.Rd @@ -12,9 +12,11 @@ constructNWISURL(siteNumber, parameterCd = "00060", startDate = "", \item{parameterCd}{string or vector of USGS parameter code. This is usually an 5 digit number.} -\item{startDate}{string starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{string ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} \item{service}{string USGS service to call. Possible values are "dv" (daily values), "uv" (unit/instantaneous values), "qw" (water quality data), "gwlevels" (groundwater),and "rating" (rating curve), "peak", "meas" (discrete streamflow measurements).} diff --git a/man/constructWQPURL.Rd b/man/constructWQPURL.Rd index 235ae776..507d2fa1 100644 --- a/man/constructWQPURL.Rd +++ b/man/constructWQPURL.Rd @@ -10,9 +10,11 @@ constructWQPURL(siteNumber, parameterCd, startDate, endDate) \item{parameterCd}{string or vector of USGS parameter code. This is usually an 5 digit number.} -\item{startDate}{string starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{string ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} } \value{ url string diff --git a/man/readNWISdv.Rd b/man/readNWISdv.Rd index a3d718bc..f566a78f 100644 --- a/man/readNWISdv.Rd +++ b/man/readNWISdv.Rd @@ -11,9 +11,11 @@ readNWISdv(siteNumber, parameterCd, startDate = "", endDate = "", \item{parameterCd}{character of USGS parameter code(s). This is usually an 5 digit number.} -\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} \item{statCd}{character USGS statistic code. This is usually 5 digits. Daily mean (00003) is the default.} } diff --git a/man/readNWISgwl.Rd b/man/readNWISgwl.Rd index cb2fac55..b44e9e1b 100644 --- a/man/readNWISgwl.Rd +++ b/man/readNWISgwl.Rd @@ -8,9 +8,11 @@ readNWISgwl(siteNumbers, startDate = "", endDate = "") \arguments{ \item{siteNumbers}{character USGS site number (or multiple sites). This is usually an 8 digit number} -\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} } \value{ A data frame with the following columns: @@ -19,7 +21,9 @@ Name \tab Type \tab Description \cr agency_cd \tab character \tab The NWIS code for the agency reporting the data\cr site_no \tab character \tab The USGS site number \cr dateTime \tab character \tab The date and time of the value as a character \cr -tz_cd \tab character \tab The time zone code for dateTime \cr +dateTimeAccuracyCd \tab character \tab Information on the date/time accuracy \cr +censorCode \tab character \tab Censoring information \cr +sourceCode \tab character \tab Information on source of the data \cr code \tab character \tab Any codes that qualify the corresponding value\cr value \tab numeric \tab The numeric value for the parameter \cr } @@ -42,7 +46,9 @@ queryTime \tab POSIXct \tab The time the data was returned \cr \description{ Reads groundwater level measurements from NWISweb. Mixed date/times come back from the service depending on the year that the data was collected. See \url{http://waterdata.usgs.gov/usa/nwis/gw} -for details about groundwater +for details about groundwater. Groundwater dates and times are returned in many different formats, therefore the +date/time information is returned as a character string. Users will need to convert to a date object. +See \url{http://waterservices.usgs.gov/rest/GW-Levels-Service.html} for more information. } \examples{ siteNumber <- "434400121275801" diff --git a/man/readNWISmeas.Rd b/man/readNWISmeas.Rd index 688300e5..80b3f661 100644 --- a/man/readNWISmeas.Rd +++ b/man/readNWISmeas.Rd @@ -8,9 +8,11 @@ readNWISmeas(siteNumber, startDate = "", endDate = "", tz = "") \arguments{ \item{siteNumber}{character USGS site number. This is usually an 8 digit number} -\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} \item{tz}{character to set timezone attribute of dateTime. Default is an empty quote, which converts the dateTimes to UTC (properly accounting for daylight savings times based on the data's provided tz_cd column). diff --git a/man/readNWISpeak.Rd b/man/readNWISpeak.Rd index 8f8cf938..b4569d82 100644 --- a/man/readNWISpeak.Rd +++ b/man/readNWISpeak.Rd @@ -8,9 +8,11 @@ readNWISpeak(siteNumber, startDate = "", endDate = "") \arguments{ \item{siteNumber}{character USGS site number. This is usually an 8 digit number} -\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} } \value{ A data frame with the following columns: diff --git a/man/readNWISqw.Rd b/man/readNWISqw.Rd index d5cd2d31..1893caf7 100644 --- a/man/readNWISqw.Rd +++ b/man/readNWISqw.Rd @@ -3,17 +3,19 @@ \alias{readNWISqw} \title{Raw Data Import for USGS NWIS QW Data} \usage{ -readNWISqw(siteNumber, pCodes, startDate = "", endDate = "", +readNWISqw(siteNumbers, pCodes, startDate = "", endDate = "", expanded = TRUE, reshape = FALSE, tz = "") } \arguments{ -\item{siteNumber}{character of USGS site numbers. This is usually an 8 digit number} +\item{siteNumbers}{character of USGS site numbers. This is usually an 8 digit number} \item{pCodes}{character of USGS parameter code(s). This is usually an 5 digit number.} -\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} \item{expanded}{logical defaults to TRUE. If TRUE, retrieves additional information. Expanded data includes remark_cd (remark code), result_va (result value), val_qual_tx (result value qualifier code), meth_cd (method code), @@ -53,16 +55,14 @@ A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table} } \examples{ -siteNumber <- c('04024430','04024000') +siteNumbers <- c('04024430','04024000') startDate <- '2010-01-01' endDate <- '' pCodes <- c('34247','30234','32104','34220') -rawNWISqwData <- readNWISqw(siteNumber,pCodes,startDate,endDate) -rawNWISqwDataExpandReshaped <- readNWISqw(siteNumber,pCodes, - startDate,endDate,expanded=TRUE) -rawNWISqwDataExpand <- readNWISqw(siteNumber,pCodes, - startDate,endDate,expanded=TRUE,reshape=FALSE) +rawNWISqwData <- readNWISqw(siteNumbers,pCodes,startDate,endDate) +rawNWISqwDataReshaped <- readNWISqw(siteNumbers,pCodes, + startDate,endDate,reshape=TRUE) } \seealso{ \code{\link{readWQPdata}}, \code{\link{whatWQPsites}}, diff --git a/man/readNWISuv.Rd b/man/readNWISuv.Rd index 900ebb0e..b8fbdcfd 100644 --- a/man/readNWISuv.Rd +++ b/man/readNWISuv.Rd @@ -11,9 +11,11 @@ readNWISuv(siteNumbers, parameterCd, startDate = "", endDate = "", \item{parameterCd}{character USGS parameter code. This is usually an 5 digit number.} -\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} \item{tz}{character to set timezone attribute of dateTime. Default is an empty quote, which converts the dateTimes to UTC (properly accounting for daylight savings times based on the data's provided tz_cd column). @@ -50,7 +52,8 @@ queryTime \tab POSIXct \tab The time the data was returned \cr \description{ Imports data from NWIS web service. This function gets the data from here: \url{http://waterservices.usgs.gov/} A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} -A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table} +A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table}. +More information on the web service can be found here: \url{http://waterservices.usgs.gov/rest/IV-Service.html}. } \examples{ siteNumber <- '05114000' diff --git a/man/readWQPqw.Rd b/man/readWQPqw.Rd index fcf45a26..8b77b23d 100644 --- a/man/readWQPqw.Rd +++ b/man/readWQPqw.Rd @@ -3,17 +3,19 @@ \alias{readWQPqw} \title{Raw Data Import for Water Quality Portal} \usage{ -readWQPqw(siteNumber, parameterCd, startDate = "", endDate = "") +readWQPqw(siteNumbers, parameterCd, startDate = "", endDate = "") } \arguments{ -\item{siteNumber}{character site number. This needs to include the full agency code prefix.} - \item{parameterCd}{vector of USGS 5-digit parameter code or characteristicNames. Leaving this blank will return all of the measured values during the specified time period.} -\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD.} +\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the earliest possible record.} -\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD.} +\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates +retrieval for the latest possible record.} + +\item{siteNumber}{character site number. This needs to include the full agency code prefix.} } \value{ retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for @@ -31,6 +33,7 @@ site name, such as 'USGS-01234567'. \dontrun{ rawPcode <- readWQPqw('USGS-01594440','01075', '', '') rawCharacteristicName <- readWQPqw('WIDNR_WQX-10032762','Specific conductance', '', '') +rawSites <- readWQPqw(c('USGS-01594440', 'USGS-01594440'), '01075','','') } } \seealso{ -- GitLab