diff --git a/DESCRIPTION b/DESCRIPTION index 9785dc0aaeb0c19044c429ed14a822483c34d6bc..d02adb0a7f84b8a9822724e1c9fdf6800d81b26d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: dataRetrieval Type: Package Title: Retrieval functions for hydrologic data -Version: 1.3.1 -Date: 2014-07-01 +Version: 1.3.2 +Date: 2014-08-04 Author: Robert M. Hirsch, Laura De Cicco Maintainer: Laura De Cicco <ldecicco@usgs.gov> Description: Collection of functions to help retrieve USGS data from either web diff --git a/NAMESPACE b/NAMESPACE index d541ef02fbf74b1b5904279c7f98f63737220830..7db39b0446d485d8c85d3fc366a0688ec9ba4ae2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,7 +17,6 @@ export(getMetaData) export(getParameterInfo) export(getQWDataFromFile) export(getRDB1Data) -export(getRawQWData) export(getSTORETSampleData) export(getSampleData) export(getSampleDataFromFile) @@ -37,9 +36,10 @@ export(populateSiteINFO) export(processQWData) export(removeDuplicates) export(renameColumns) -export(retrieveNWISData) +export(retrieveNWISdvData) export(retrieveNWISqwData) -export(retrieveUnitNWISData) +export(retrieveNWISunitData) +export(retrieveWQPqwData) import(RCurl) import(XML) import(reshape2) diff --git a/NEWS b/NEWS index 20ef1f46e5e43500c03b4247a8621209b93ef533..0c14291543e686b98068355715149c5b7b2c0a74 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +dataRetrieval 1.3.2 +=========== + +* Deprecated getQWData, updated getWQPData to take either parameter code or characteristic name. +* Changed the name of raw data retrievals to: retrieveNWISqwData, retrieveNWISunitData, retrieveNWISdvData, and retrieveWQPqwData (from: retrieveNWISqwData, retrieveUnitNWISData, retrieveNWISData, getRawQWData) +* Added NA warning to getDVData function + + dataRetrieval 1.2.2 =========== diff --git a/R/getDVData.r b/R/getDVData.r index d98ee3b176440d1a65d697cd718421e9dd216e82..a35374be178a609e1812c6692bc1b52294d6e161 100644 --- a/R/getDVData.r +++ b/R/getDVData.r @@ -18,14 +18,14 @@ #' @keywords data import USGS WRTDS #' @export #' @return Daily dataframe -#' @seealso \code{\link{retrieveNWISData}}, \code{\link{populateDaily}} +#' @seealso \code{\link{retrieveNWISdvData}}, \code{\link{populateDaily}} #' @examples #' # These examples require an internet connection to run #' Daily <- getDVData('01594440','00060', '1985-01-01', '1985-03-31') #' DailyCFS <- getDVData('01594440','00060', '1985-01-01', '1985-03-31',convert=FALSE) #' DailySuspSediment <- getDVData('01594440','80154', '1985-01-01', '1985-03-31') getDVData <- function (siteNumber,ParameterCd,StartDate,EndDate,interactive=TRUE,convert=TRUE,format="tsv"){ - data <- retrieveNWISData(siteNumber,ParameterCd,StartDate,EndDate,interactive=interactive,format=format) + data <- retrieveNWISdvData(siteNumber,ParameterCd,StartDate,EndDate,interactive=interactive,format=format) # need to setup conversion factor because the NWIS data are in cfs but we store in cms names(data) <- c('agency', 'site', 'dateTime', 'value', 'code') # do a merge instead? diff --git a/R/getRawQWData.r b/R/getRawQWData.r index f647afdbb2d1746d9a831d8b268f3e88571858c0..393f558812c32cdebf8976568b1c1203245ef5d3 100644 --- a/R/getRawQWData.r +++ b/R/getRawQWData.r @@ -16,11 +16,11 @@ #' @import RCurl #' @examples #' # These examples require an internet connection to run -#' rawSample <- getRawQWData('USGS-01594440','01075', '1985-01-01', '1985-03-31') -#' rawSampleAll <- getRawQWData('USGS-05114000','', '1985-01-01', '1985-03-31') -#' rawSampleSelect <- getRawQWData('USGS-05114000',c('00915','00931'), '1985-01-01', '1985-04-30') -#' rawStoret <- getRawQWData('WIDNR_WQX-10032762','Specific conductance', '', '') -getRawQWData <- function(siteNumber,ParameterCd,StartDate,EndDate,interactive=TRUE){ +#' rawSample <- retrieveWQPqwData('USGS-01594440','01075', '1985-01-01', '1985-03-31') +#' rawSampleAll <- retrieveWQPqwData('USGS-05114000','', '1985-01-01', '1985-03-31') +#' rawSampleSelect <- retrieveWQPqwData('USGS-05114000',c('00915','00931'), '1985-01-01', '1985-04-30') +#' rawStoret <- retrieveWQPqwData('WIDNR_WQX-10032762','Specific conductance', '', '') +retrieveWQPqwData <- function(siteNumber,ParameterCd,StartDate,EndDate,interactive=TRUE){ url <- constructNWISURL(siteNumber,ParameterCd,StartDate,EndDate,"wqp",interactive=interactive) diff --git a/R/getWQPData.r b/R/getWQPData.r index b19957757b4cc6b2d5cd55410547cc3cf097ce1b..e48bc07c15f06e6d0a2ca4530e5711d387cc0e5c 100644 --- a/R/getWQPData.r +++ b/R/getWQPData.r @@ -21,7 +21,7 @@ #' NWIS_Cl <- getWQPData('USGS-04024000','30234', '', '') getWQPData <- function(siteNumber,characteristicName,StartDate,EndDate,interactive=TRUE){ - retval <- getRawQWData(siteNumber=siteNumber, + retval <- retrieveWQPqwData(siteNumber=siteNumber, ParameterCd=characteristicName, StartDate=StartDate, EndDate=EndDate, diff --git a/R/populateDaily.r b/R/populateDaily.r index 9a3d4fff015081f450dc8726a9c67048649434f6..2ec2d3ed66d39e59db1361729859076842e20ff2 100644 --- a/R/populateDaily.r +++ b/R/populateDaily.r @@ -51,14 +51,9 @@ populateDaily <- function(rawData,qConvert,interactive=TRUE){ # rawData is a da qshift<- 0.001*mean(localDaily$Q, na.rm=TRUE) if (interactive){ - negNums <- length(which(localDaily$Q<0)) - zeroNums <- length(which(localDaily$Q == 0)) - - if (negNums > 0) { - cat("There were", as.character(negNums), "negative flow days \n") - cat("Negative values are not supported in the EGRET package\n") - } + zeroNums <- length(which(localDaily$Q == 0)) + if (zeroNums > 0){ cat("There were", as.character(zeroNums), "zero flow days \n") } @@ -70,6 +65,11 @@ populateDaily <- function(rawData,qConvert,interactive=TRUE){ # rawData is a da qshift<-0.0 } + negNums <- length(which(localDaily$Q<0)) + if (negNums > 0) { + cat("There were", as.character(negNums), "negative flow days \n") + cat("Negative values are not supported in the EGRET package\n") + } localDaily$Q<-localDaily$Q+qshift @@ -94,7 +94,20 @@ populateDaily <- function(rawData,qConvert,interactive=TRUE){ # rawData is a da #these next two lines show the user where the gaps in the data are if there are any n<-nrow(localDaily) - for(i in 2:n) {if((localDaily$Julian[i]-localDaily$Julian[i-1])>1) cat("\n discharge data jumps from",as.character(localDaily$Date[i-1]),"to",as.character(localDaily$Date[i]))} + for(i in 2:n) { + if((localDaily$Julian[i]-localDaily$Julian[i-1])>1) cat("\n discharge data jumps from",as.character(localDaily$Date[i-1]),"to",as.character(localDaily$Date[i])) + } + + numNAs <- sum(is.na(localDaily$Q)) + if(numNAs > 0){ + cat(numNAs, "discharge measurements are not reported (NA's). \nMany of the EGRET functions will not work with missing discharge measurements.") + if (localDaily$Julian[max(which(is.na(localDaily$Q)),na.rm = TRUE)]- + localDaily$Julian[min(which(is.na(localDaily$Q)),na.rm = TRUE)]+1 == numNAs){ + cat("\nNA gap is from",as.character(localDaily$Date[min(which(is.na(localDaily$Q)),na.rm = TRUE)]),"to", + as.character(localDaily$Date[max(which(is.na(localDaily$Q)),na.rm = TRUE)])) + } + } + } return (localDaily) diff --git a/R/processQWData.r b/R/processQWData.r index 31d76275d418b7de00d5e9ec57e11230dad0659c..2779b108d6647559f381bab592affd327e030d01 100644 --- a/R/processQWData.r +++ b/R/processQWData.r @@ -12,7 +12,7 @@ #' @export #' @examples #' # These examples require an internet connection to run -#' rawSample <- getRawQWData('USGS-01594440','01075', '1985-01-01', '1985-03-31') +#' rawSample <- retrieveWQPqwData('USGS-01594440','01075', '1985-01-01', '1985-03-31') #' rawSampleSelect <- processQWData(rawSample) processQWData <- function(data,pCode=TRUE){ diff --git a/R/renameColumns.R b/R/renameColumns.R index fe4bb30e384b4d268871c94763a13425d0c3c5c5..e8414376e334b6af02b1235ee7a3e03e77c67ba7 100644 --- a/R/renameColumns.R +++ b/R/renameColumns.R @@ -9,10 +9,10 @@ #' @examples #' # This example requires an internet connection to run #' siteNumber <- '05114000' -#' rawData <- retrieveNWISData(siteNumber,c("00010","00060","00300"),"2001-01-01","2002-01-01",StatCd=c("00001","00003")) +#' rawData <- retrieveNWISdvData(siteNumber,c("00010","00060","00300"),"2001-01-01","2002-01-01",StatCd=c("00001","00003")) #' rawData <- renameColumns(rawData) #' today <- as.character(Sys.Date()) -#' rawData2 <- retrieveUnitNWISData(siteNumber,c("00010","00060"),today,today) +#' rawData2 <- retrieveNWISunitData(siteNumber,c("00010","00060"),today,today) #' rawData2 <- renameColumns(rawData2) renameColumns <- function(rawData){ diff --git a/R/retrieveNWISData.r b/R/retrieveNWISData.r index 5835f762dc488f8512d04663e5e5b92c779fd324..b003fd98fb385c6a14c3095a577b60027f14738a 100644 --- a/R/retrieveNWISData.r +++ b/R/retrieveNWISData.r @@ -22,11 +22,11 @@ #' startDate <- '2012-01-01' #' endDate <- '2012-06-30' #' pCode <- '00060' -#' rawDailyQ <- retrieveNWISData(siteNumber,pCode, startDate, endDate) -#' rawDailyTemperature <- retrieveNWISData(siteNumber,'00010', startDate, endDate, StatCd='00001') -#' rawDailyTemperatureTSV <- retrieveNWISData(siteNumber,'00010', startDate, endDate, StatCd='00001',format='tsv') -#' rawDailyQAndTempMeanMax <- retrieveNWISData(siteNumber,c('00010','00060'), startDate, endDate, StatCd=c('00001','00003')) -retrieveNWISData <- function (siteNumber,ParameterCd,StartDate,EndDate,StatCd="00003",format="tsv",interactive=TRUE){ +#' rawDailyQ <- retrieveNWISdvData(siteNumber,pCode, startDate, endDate) +#' rawDailyTemperature <- retrieveNWISdvData(siteNumber,'00010', startDate, endDate, StatCd='00001') +#' rawDailyTemperatureTSV <- retrieveNWISdvData(siteNumber,'00010', startDate, endDate, StatCd='00001',format='tsv') +#' rawDailyQAndTempMeanMax <- retrieveNWISdvData(siteNumber,c('00010','00060'), startDate, endDate, StatCd=c('00001','00003')) +retrieveNWISdvData <- function (siteNumber,ParameterCd,StartDate,EndDate,StatCd="00003",format="tsv",interactive=TRUE){ url <- constructNWISURL(siteNumber,ParameterCd,StartDate,EndDate,"dv",statCd=StatCd,format=format,interactive=interactive) diff --git a/R/retrieveUnitNWISData.r b/R/retrieveUnitNWISData.r index aa9102675ee7b55ae26c4b33d960e676c71e3a72..1e2d5bd6fe1e7d10b9f53b9fa17001a2728f6333 100644 --- a/R/retrieveUnitNWISData.r +++ b/R/retrieveUnitNWISData.r @@ -21,9 +21,9 @@ #' StartDate <- as.character(Sys.Date()) #' EndDate <- as.character(Sys.Date()) #' # These examples require an internet connection to run -#' rawData <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate) -#' rawData2 <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate,"tsv") -retrieveUnitNWISData <- function (siteNumber,ParameterCd,StartDate,EndDate,format="xml",interactive=TRUE){ +#' rawData <- retrieveNWISunitData(siteNumber,ParameterCd,StartDate,EndDate) +#' rawData2 <- retrieveNWISunitData(siteNumber,ParameterCd,StartDate,EndDate,"tsv") +retrieveNWISunitData <- function (siteNumber,ParameterCd,StartDate,EndDate,format="xml",interactive=TRUE){ url <- constructNWISURL(siteNumber,ParameterCd,StartDate,EndDate,"uv",format=format,interactive=interactive) if (format == "xml") { diff --git a/man/getDVData.Rd b/man/getDVData.Rd index 64b881747ac7d629e10488fe2dd4db48316a4db5..be9af2d0fbb161528468db6f608811ae76c5795e 100644 --- a/man/getDVData.Rd +++ b/man/getDVData.Rd @@ -40,7 +40,7 @@ DailyCFS <- getDVData('01594440','00060', '1985-01-01', '1985-03-31',convert=FAL DailySuspSediment <- getDVData('01594440','80154', '1985-01-01', '1985-03-31') } \seealso{ -\code{\link{retrieveNWISData}}, \code{\link{populateDaily}} +\code{\link{retrieveNWISdvData}}, \code{\link{populateDaily}} } \keyword{USGS} \keyword{WRTDS} diff --git a/man/processQWData.Rd b/man/processQWData.Rd index 31d404e1c5b13ad9cbf30c0bb3f4ce850268a999..a1df95dda27c70d59ae87530326f4bf7dc176919 100644 --- a/man/processQWData.Rd +++ b/man/processQWData.Rd @@ -21,7 +21,7 @@ conditions to determine if a value is left censored or not. Censored values are } \examples{ # These examples require an internet connection to run -rawSample <- getRawQWData('USGS-01594440','01075', '1985-01-01', '1985-03-31') +rawSample <- retrieveWQPqwData('USGS-01594440','01075', '1985-01-01', '1985-03-31') rawSampleSelect <- processQWData(rawSample) } \keyword{USGS} diff --git a/man/renameColumns.Rd b/man/renameColumns.Rd index 6a67074a6c714a3c4b6afd72ad3384792689e62f..0a07040c9e83f2f39f5beae4c84e0d831111a427 100644 --- a/man/renameColumns.Rd +++ b/man/renameColumns.Rd @@ -17,10 +17,10 @@ Rename columns coming back from NWIS data retrievals \examples{ # This example requires an internet connection to run siteNumber <- '05114000' -rawData <- retrieveNWISData(siteNumber,c("00010","00060","00300"),"2001-01-01","2002-01-01",StatCd=c("00001","00003")) +rawData <- retrieveNWISdvData(siteNumber,c("00010","00060","00300"),"2001-01-01","2002-01-01",StatCd=c("00001","00003")) rawData <- renameColumns(rawData) today <- as.character(Sys.Date()) -rawData2 <- retrieveUnitNWISData(siteNumber,c("00010","00060"),today,today) +rawData2 <- retrieveNWISunitData(siteNumber,c("00010","00060"),today,today) rawData2 <- renameColumns(rawData2) } \keyword{USGS} diff --git a/man/retrieveNWISData.Rd b/man/retrieveNWISdvData.Rd similarity index 78% rename from man/retrieveNWISData.Rd rename to man/retrieveNWISdvData.Rd index 92c25247e99f7300dc9e55338150129165a3f128..1665a85779a11b310a2d748f0f8f3554fda06e11 100644 --- a/man/retrieveNWISData.Rd +++ b/man/retrieveNWISdvData.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2 (4.0.1): do not edit by hand -\name{retrieveNWISData} -\alias{retrieveNWISData} +\name{retrieveNWISdvData} +\alias{retrieveNWISdvData} \title{Raw Data Import for USGS NWIS Data} \usage{ -retrieveNWISData(siteNumber, ParameterCd, StartDate, EndDate, +retrieveNWISdvData(siteNumber, ParameterCd, StartDate, EndDate, StatCd = "00003", format = "tsv", interactive = TRUE) } \arguments{ @@ -37,10 +37,10 @@ siteNumber <- '04085427' startDate <- '2012-01-01' endDate <- '2012-06-30' pCode <- '00060' -rawDailyQ <- retrieveNWISData(siteNumber,pCode, startDate, endDate) -rawDailyTemperature <- retrieveNWISData(siteNumber,'00010', startDate, endDate, StatCd='00001') -rawDailyTemperatureTSV <- retrieveNWISData(siteNumber,'00010', startDate, endDate, StatCd='00001',format='tsv') -rawDailyQAndTempMeanMax <- retrieveNWISData(siteNumber,c('00010','00060'), startDate, endDate, StatCd=c('00001','00003')) +rawDailyQ <- retrieveNWISdvData(siteNumber,pCode, startDate, endDate) +rawDailyTemperature <- retrieveNWISdvData(siteNumber,'00010', startDate, endDate, StatCd='00001') +rawDailyTemperatureTSV <- retrieveNWISdvData(siteNumber,'00010', startDate, endDate, StatCd='00001',format='tsv') +rawDailyQAndTempMeanMax <- retrieveNWISdvData(siteNumber,c('00010','00060'), startDate, endDate, StatCd=c('00001','00003')) } \keyword{USGS} \keyword{data} diff --git a/man/retrieveUnitNWISData.Rd b/man/retrieveNWISunitData.Rd similarity index 88% rename from man/retrieveUnitNWISData.Rd rename to man/retrieveNWISunitData.Rd index 05b8d4ea11332916f8c023e1eb217fdb1ef07ae4..c630e9179c45c3b5f4a1a1159f2642e79ab68157 100644 --- a/man/retrieveUnitNWISData.Rd +++ b/man/retrieveNWISunitData.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2 (4.0.1): do not edit by hand -\name{retrieveUnitNWISData} -\alias{retrieveUnitNWISData} +\name{retrieveNWISunitData} +\alias{retrieveNWISunitData} \title{Raw Data Import for Instantaneous USGS NWIS Data} \usage{ -retrieveUnitNWISData(siteNumber, ParameterCd, StartDate, EndDate, +retrieveNWISunitData(siteNumber, ParameterCd, StartDate, EndDate, format = "xml", interactive = TRUE) } \arguments{ @@ -35,8 +35,8 @@ ParameterCd <- '00060' StartDate <- as.character(Sys.Date()) EndDate <- as.character(Sys.Date()) # These examples require an internet connection to run -rawData <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate) -rawData2 <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate,"tsv") +rawData <- retrieveNWISunitData(siteNumber,ParameterCd,StartDate,EndDate) +rawData2 <- retrieveNWISunitData(siteNumber,ParameterCd,StartDate,EndDate,"tsv") } \keyword{USGS} \keyword{data} diff --git a/man/getRawQWData.Rd b/man/retrieveWQPqwData.Rd similarity index 73% rename from man/getRawQWData.Rd rename to man/retrieveWQPqwData.Rd index 3b99d6ce91536babf5edd7ff80940881d805ea67..d679f2fdf5b9fa9cb76371fb05446f106e815cce 100644 --- a/man/getRawQWData.Rd +++ b/man/retrieveWQPqwData.Rd @@ -1,9 +1,10 @@ % Generated by roxygen2 (4.0.1): do not edit by hand -\name{getRawQWData} -\alias{getRawQWData} +\name{retrieveWQPqwData} +\alias{retrieveWQPqwData} \title{Raw Data Import for USGS NWIS Water Quality Data} \usage{ -getRawQWData(siteNumber, ParameterCd, StartDate, EndDate, interactive = TRUE) +retrieveWQPqwData(siteNumber, ParameterCd, StartDate, EndDate, + interactive = TRUE) } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} @@ -27,10 +28,10 @@ A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov } \examples{ # These examples require an internet connection to run -rawSample <- getRawQWData('USGS-01594440','01075', '1985-01-01', '1985-03-31') -rawSampleAll <- getRawQWData('USGS-05114000','', '1985-01-01', '1985-03-31') -rawSampleSelect <- getRawQWData('USGS-05114000',c('00915','00931'), '1985-01-01', '1985-04-30') -rawStoret <- getRawQWData('WIDNR_WQX-10032762','Specific conductance', '', '') +rawSample <- retrieveWQPqwData('USGS-01594440','01075', '1985-01-01', '1985-03-31') +rawSampleAll <- retrieveWQPqwData('USGS-05114000','', '1985-01-01', '1985-03-31') +rawSampleSelect <- retrieveWQPqwData('USGS-05114000',c('00915','00931'), '1985-01-01', '1985-04-30') +rawStoret <- retrieveWQPqwData('WIDNR_WQX-10032762','Specific conductance', '', '') } \keyword{USGS} \keyword{data} diff --git a/vignettes/dataRetrieval.Rnw b/vignettes/dataRetrieval.Rnw index 10862cbb57c73b20f9e0047d65c9ca00d06e2367..d8cdc041b5cb59a67a93b3763c2a0a375e520a11 100644 --- a/vignettes/dataRetrieval.Rnw +++ b/vignettes/dataRetrieval.Rnw @@ -387,7 +387,7 @@ Parameter information is obtained from \url{http://nwis.waterdata.usgs.gov/nwis/ \subsection{Daily Values} \label{sec:usgsDaily} %------------------------------------------------------------ -To obtain daily records of USGS data, use the \texttt{retrieveNWISData} function. The arguments for this function are siteNumber, parameterCd, startDate, endDate, statCd, and a logical (TRUE/FALSE) interactive. There are 2 default arguments: statCd (defaults to \texttt{"}00003\texttt{"}), and interactive (defaults to TRUE). If you want to use the default values, you do not need to list them in the function call. By setting the \texttt{"}interactive\texttt{"} option to FALSE, the operation of the function will advance automatically. It might make more sense to run large batch collections with the interactive option set to FALSE. +To obtain daily records of USGS data, use the \texttt{retrieveNWISdvData} function. The arguments for this function are siteNumber, parameterCd, startDate, endDate, statCd, and a logical (TRUE/FALSE) interactive. There are 2 default arguments: statCd (defaults to \texttt{"}00003\texttt{"}), and interactive (defaults to TRUE). If you want to use the default values, you do not need to list them in the function call. By setting the \texttt{"}interactive\texttt{"} option to FALSE, the operation of the function will advance automatically. It might make more sense to run large batch collections with the interactive option set to FALSE. The dates (start and end) must be in the format \texttt{"}YYYY-MM-DD\texttt{"} (note: the user must include the quotes). Setting the start date to \texttt{"}\texttt{"} (no space) will prompt the program to ask for the earliest date, and setting the end date to \texttt{"}\texttt{"} (no space) will prompt for the latest available date. @@ -398,7 +398,7 @@ parameterCd <- "00060" # Discharge (ft3/s) startDate <- "" # Will request earliest date endDate <- "" # Will request latest date -discharge <- retrieveNWISData(siteNumber, +discharge <- retrieveNWISdvData(siteNumber, parameterCd, startDate, endDate) names(discharge) @ @@ -414,7 +414,7 @@ statCd <- c("00001","00003") # Mean and maximum startDate <- "2012-01-01" endDate <- "2012-05-01" -temperatureAndFlow <- retrieveNWISData(siteNumber, parameterCd, +temperatureAndFlow <- retrieveNWISdvData(siteNumber, parameterCd, startDate, endDate, StatCd=statCd) @ @@ -460,14 +460,14 @@ There are occasions where NWIS values are not reported as numbers, instead there \subsection{Unit Values} \label{sec:usgsRT} %------------------------------------------------------------ -Any data collected at regular time intervals (such as 15-minute or hourly) are known as \enquote{unit values}. Many of these are delivered on a real time basis and very recent data (even less than an hour old in many cases) are available through the function \texttt{retrieveUnitNWISData}. Some of these unit values are available for many years, and some are only available for a recent time period such as 120 days. Here is an example of a retrieval of such data. +Any data collected at regular time intervals (such as 15-minute or hourly) are known as \enquote{unit values}. Many of these are delivered on a real time basis and very recent data (even less than an hour old in many cases) are available through the function \texttt{retrieveNWISunitData}. Some of these unit values are available for many years, and some are only available for a recent time period such as 120 days. Here is an example of a retrieval of such data. <<label=getNWISUnit, echo=TRUE>>= parameterCd <- "00060" # Discharge (ft3/s) startDate <- "2012-05-12" endDate <- "2012-05-13" -dischargeToday <- retrieveUnitNWISData(siteNumber, parameterCd, +dischargeToday <- retrieveNWISunitData(siteNumber, parameterCd, startDate, endDate) @