Skip to content
Snippets Groups Projects
Commit 8255cce3 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Automated help file builds.

parent 348f2c45
No related branches found
No related tags found
1 merge request!9Added a lot of error handling.
...@@ -28,7 +28,9 @@ comment2 <- c("","<","") ...@@ -28,7 +28,9 @@ comment2 <- c("","<","")
value2 <- c(2,3,4) value2 <- c(2,3,4)
comment3 <- c("","","<") comment3 <- c("","","<")
value3 <- c(3,4,5) value3 <- c(3,4,5)
dataInput <- data.frame(dateTime, comment1, value1, comment2, value2, comment3, value3, stringsAsFactors=FALSE) dataInput <- data.frame(dateTime, comment1, value1,
comment2, value2,
comment3, value3, stringsAsFactors=FALSE)
compressData(dataInput) compressData(dataInput)
} }
\keyword{WRTDS} \keyword{WRTDS}
......
...@@ -41,12 +41,16 @@ siteNumber <- '01594440' ...@@ -41,12 +41,16 @@ siteNumber <- '01594440'
startDate <- '1985-01-01' startDate <- '1985-01-01'
endDate <- '' endDate <- ''
pCode <- c("00060","00010") pCode <- c("00060","00010")
url_daily <- constructNWISURL(siteNumber,pCode,startDate,endDate,'dv',statCd=c("00003","00001")) url_daily <- constructNWISURL(siteNumber,pCode,
startDate,endDate,'dv',statCd=c("00003","00001"))
url_unit <- constructNWISURL(siteNumber,pCode,"2012-06-28","2012-06-30",'iv') url_unit <- constructNWISURL(siteNumber,pCode,"2012-06-28","2012-06-30",'iv')
url_qw_single <- constructNWISURL(siteNumber,"01075",startDate,endDate,'qw') url_qw_single <- constructNWISURL(siteNumber,"01075",startDate,endDate,'qw')
url_qw <- constructNWISURL(siteNumber,c('01075','00029','00453'),startDate,endDate,'qw') url_qw <- constructNWISURL(siteNumber,c('01075','00029','00453'),
url_wqp <- constructNWISURL(paste("USGS",siteNumber,sep="-"),c('01075','00029','00453'),startDate,endDate,'wqp') startDate,endDate,'qw')
url_daily_tsv <- constructNWISURL(siteNumber,pCode,startDate,endDate,'dv',statCd=c("00003","00001"),format="tsv") url_wqp <- constructNWISURL(paste("USGS",siteNumber,sep="-"),c('01075','00029','00453'),
startDate,endDate,'wqp')
url_daily_tsv <- constructNWISURL(siteNumber,pCode,startDate,endDate,'dv',
statCd=c("00003","00001"),format="tsv")
} }
\keyword{USGS} \keyword{USGS}
\keyword{data} \keyword{data}
......
...@@ -19,8 +19,6 @@ Checks that the site code is at least 8 digits. If not, it confirms with the use ...@@ -19,8 +19,6 @@ Checks that the site code is at least 8 digits. If not, it confirms with the use
\examples{ \examples{
site<- '01234567' site<- '01234567'
formatCheckSiteNumber(site) formatCheckSiteNumber(site)
site_incorrect <- '1234567'
formatCheckSiteNumber(site_incorrect)
} }
\keyword{WRTDS} \keyword{WRTDS}
\keyword{flow} \keyword{flow}
......
...@@ -28,7 +28,7 @@ The third column is optional, it contains any remark codes. ...@@ -28,7 +28,7 @@ The third column is optional, it contains any remark codes.
filePath <- system.file("extdata", package="dataRetrieval") filePath <- system.file("extdata", package="dataRetrieval")
filePath <- paste(filePath,"/",sep="") filePath <- paste(filePath,"/",sep="")
fileName <- 'ChoptankRiverFlow.txt' fileName <- 'ChoptankRiverFlow.txt'
getDataFromFile(filePath,fileName, separator="\\t") ChopData <- getDataFromFile(filePath,fileName, separator="\\t")
} }
\keyword{data} \keyword{data}
\keyword{file} \keyword{file}
......
...@@ -18,14 +18,19 @@ This function accepts a url parameter that already contains the desired ...@@ -18,14 +18,19 @@ This function accepts a url parameter that already contains the desired
NWIS site, parameter code, statistic, startdate and enddate. NWIS site, parameter code, statistic, startdate and enddate.
} }
\examples{ \examples{
sites <- "02177000" siteNumber <- "02177000"
startDate <- "2012-09-01" startDate <- "2012-09-01"
endDate <- "2012-10-01" endDate <- "2012-10-01"
offering <- '00003' offering <- '00003'
property <- '00060' property <- '00060'
obs_url <- constructNWISURL(sites,property,startDate,endDate,'dv',format='tsv') obs_url <- constructNWISURL(siteNumber,property,
startDate,endDate,'dv',format='tsv')
data <- getRDB1Data(obs_url) data <- getRDB1Data(obs_url)
urlMulti <- constructNWISURL("04085427",c("00060","00010"),startDate,endDate,'dv',statCd=c("00003","00001"),'tsv') urlMulti <- constructNWISURL("04085427",c("00060","00010"),
startDate,endDate,'dv',statCd=c("00003","00001"),'tsv')
multiData <- getRDB1Data(urlMulti) multiData <- getRDB1Data(urlMulti)
unitDataURL <- constructNWISURL(siteNumber,property,
as.character(Sys.Date()),as.character(Sys.Date()),'uv',format='tsv')
unitData <- getRDB1Data(unitDataURL, asDateT=TRUE)
} }
...@@ -16,16 +16,21 @@ This function accepts a url parameter that already contains the desired ...@@ -16,16 +16,21 @@ This function accepts a url parameter that already contains the desired
NWIS site, parameter code, statistic, startdate and enddate. NWIS site, parameter code, statistic, startdate and enddate.
} }
\examples{ \examples{
sites <- "02177000" siteNumber <- "02177000"
startDate <- "2012-09-01" startDate <- "2012-09-01"
endDate <- "2012-10-01" endDate <- "2012-10-01"
offering <- '00003' offering <- '00003'
property <- '00060' property <- '00060'
obs_url <- constructNWISURL(sites,property,startDate,endDate,'dv') obs_url <- constructNWISURL(siteNumber,property,startDate,endDate,'dv')
data <- getWaterML1Data(obs_url) data <- getWaterML1Data(obs_url)
urlMulti <- constructNWISURL("04085427",c("00060","00010"),startDate,endDate,'dv',statCd=c("00003","00001")) urlMulti <- constructNWISURL("04085427",c("00060","00010"),
startDate,endDate,'dv',statCd=c("00003","00001"))
multiData <- getWaterML1Data(urlMulti) multiData <- getWaterML1Data(urlMulti)
goundwaterExampleURL <- "http://waterservices.usgs.gov/nwis/gwlevels/?format=waterml&sites=431049071324301&startDT=2013-10-01&endDT=2014-06-30" goundwaterExampleURL <-
"http://waterservices.usgs.gov/nwis/gwlevels/?format=waterml&sites=431049071324301&startDT=2013-10-01&endDT=2014-06-30"
groundWater <- getWaterML1Data(goundwaterExampleURL) groundWater <- getWaterML1Data(goundwaterExampleURL)
unitDataURL <- constructNWISURL(siteNumber,property,
as.character(Sys.Date()),as.character(Sys.Date()),'uv',format='xml')
unitData <- getWaterML1Data(unitDataURL)
} }
...@@ -17,7 +17,8 @@ Rename columns coming back from NWIS data retrievals ...@@ -17,7 +17,8 @@ Rename columns coming back from NWIS data retrievals
\examples{ \examples{
# This example requires an internet connection to run # This example requires an internet connection to run
siteNumber <- '05114000' siteNumber <- '05114000'
rawData <- retrieveNWISdvData(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) rawData <- renameColumns(rawData)
today <- as.character(Sys.Date()) today <- as.character(Sys.Date())
rawData2 <- retrieveNWISunitData(siteNumber,c("00010","00060"),today,today) rawData2 <- retrieveNWISunitData(siteNumber,c("00010","00060"),today,today)
......
...@@ -38,9 +38,12 @@ startDate <- '2012-01-01' ...@@ -38,9 +38,12 @@ startDate <- '2012-01-01'
endDate <- '2012-06-30' endDate <- '2012-06-30'
pCode <- '00060' pCode <- '00060'
rawDailyQ <- retrieveNWISdvData(siteNumber,pCode, startDate, endDate) rawDailyQ <- retrieveNWISdvData(siteNumber,pCode, startDate, endDate)
rawDailyTemperature <- retrieveNWISdvData(siteNumber,'00010', startDate, endDate, statCd='00001') rawDailyTemperature <- retrieveNWISdvData(siteNumber,'00010',
rawDailyTemperatureTSV <- retrieveNWISdvData(siteNumber,'00010', startDate, endDate, statCd='00001',format='tsv') startDate, endDate, statCd='00001')
rawDailyQAndTempMeanMax <- retrieveNWISdvData(siteNumber,c('00010','00060'), startDate, endDate, statCd=c('00001','00003')) 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{USGS}
\keyword{data} \keyword{data}
......
...@@ -9,7 +9,7 @@ retrieveWQPqwData(siteNumber, parameterCd, startDate, endDate, ...@@ -9,7 +9,7 @@ retrieveWQPqwData(siteNumber, parameterCd, startDate, endDate,
\arguments{ \arguments{
\item{siteNumber}{string USGS site number. This is usually an 8 digit number} \item{siteNumber}{string USGS site number. This is usually an 8 digit number}
\item{parameterCd}{vector of USGS 5-digit parameter code. Leaving this blank will return all of the measured values during the specified time period.} \item{parameterCd}{vector of USGS 5-digit parameter code or string of characteristicNames. Leaving this blank will return all of the measured values during the specified time period.}
\item{startDate}{string starting date for data retrieval in the form YYYY-MM-DD.} \item{startDate}{string starting date for data retrieval in the form YYYY-MM-DD.}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment