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

Getting rid of all external server calls.

parent 30c5c519
No related branches found
No related tags found
1 merge request!76Taking out external call on check.
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
#' offering <- '00003' #' offering <- '00003'
#' property <- '00060' #' property <- '00060'
#' obs_url <- constructNWISURL(siteNumber,property,startDate,endDate,'dv') #' obs_url <- constructNWISURL(siteNumber,property,startDate,endDate,'dv')
#' \dontrun{
#' rawData <- getWebServiceData(obs_url) #' rawData <- getWebServiceData(obs_url)
#' }
getWebServiceData <- function(obs_url){ getWebServiceData <- function(obs_url){
possibleError <- tryCatch({ possibleError <- tryCatch({
h <- basicHeaderGatherer() h <- basicHeaderGatherer()
......
...@@ -49,8 +49,9 @@ ...@@ -49,8 +49,9 @@
#' #'
#' obs_url <- constructNWISURL(siteNumber,property, #' obs_url <- constructNWISURL(siteNumber,property,
#' startDate,endDate,"dv",format="tsv") #' startDate,endDate,"dv",format="tsv")
#' data <- importRDB1(obs_url)
#' \dontrun{ #' \dontrun{
#' data <- importRDB1(obs_url)
#'
#' urlMultiPcodes <- constructNWISURL("04085427",c("00060","00010"), #' urlMultiPcodes <- constructNWISURL("04085427",c("00060","00010"),
#' startDate,endDate,"dv",statCd=c("00003","00001"),"tsv") #' startDate,endDate,"dv",statCd=c("00003","00001"),"tsv")
#' multiData <- importRDB1(urlMultiPcodes) #' multiData <- importRDB1(urlMultiPcodes)
......
...@@ -35,17 +35,12 @@ ...@@ -35,17 +35,12 @@
#' "statCd=00003", #' "statCd=00003",
#' "parameterCd=00060",sep="&") #' "parameterCd=00060",sep="&")
#' dataReturnMulti <- importWaterML2(URLmulti) #' dataReturnMulti <- importWaterML2(URLmulti)
#'
#' filePath <- system.file("extdata", package="dataRetrieval")
#' fileName <- "WaterML2Example.xml"
#' fullPath <- file.path(filePath, fileName)
#' UserData <- importWaterML2(fullPath)
#' } #' }
#' filePath <- system.file("extdata", package="dataRetrieval") #' filePath <- system.file("extdata", package="dataRetrieval")
#' fileName <- "WaterML2Example.xml" #' fileName <- "WaterML2Example.xml"
#' fullPath <- file.path(filePath, fileName) #' fullPath <- file.path(filePath, fileName)
#' UserData <- importWaterML2(fullPath)
#' #'
#' fileData <- importWaterML2(fullPath)
importWaterML2 <- function(obs_url, asDateTime=FALSE, tz=""){ importWaterML2 <- function(obs_url, asDateTime=FALSE, tz=""){
if(file.exists(obs_url)){ if(file.exists(obs_url)){
......
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
#' parameterCd <- '00060' #' parameterCd <- '00060'
#' startDate <- "2014-10-10" #' startDate <- "2014-10-10"
#' endDate <- "2014-10-10" #' endDate <- "2014-10-10"
#' # These examples require an internet connection to run
#' rawData <- readNWISuv(siteNumber,parameterCd,startDate,endDate)
#' \dontrun{ #' \dontrun{
#' rawData <- readNWISuv(siteNumber,parameterCd,startDate,endDate)
#'
#' timeZoneChange <- readNWISuv(c('04024430','04024000'),parameterCd, #' timeZoneChange <- readNWISuv(c('04024430','04024000'),parameterCd,
#' "2013-11-03","2013-11-03") #' "2013-11-03","2013-11-03")
#' } #' }
......
...@@ -42,9 +42,11 @@ ...@@ -42,9 +42,11 @@
#' siteWithTwo <- '01480015' #' siteWithTwo <- '01480015'
#' startDate <- "2012-09-01" #' startDate <- "2012-09-01"
#' endDate <- "2012-10-01" #' endDate <- "2012-10-01"
#' \dontrun{
#' url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv') #' url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv')
#' twoResults <- importWaterML1(url2,TRUE) #' twoResults <- importWaterML1(url2,TRUE)
#' twoResults <- renameNWISColumns(twoResults) #' twoResults <- renameNWISColumns(twoResults)
#' }
renameNWISColumns <- function(rawData, p00010="Wtemp", p00045="Precip", renameNWISColumns <- function(rawData, p00010="Wtemp", p00045="Precip",
p00060="Flow", p00065="GH", p00095="SpecCond", p00300="DO", p00060="Flow", p00065="GH", p00095="SpecCond", p00300="DO",
p00400="pH", p62611="GWL", p63680="Turb", p72019="WLBLS", p00400="pH", p62611="GWL", p63680="Turb", p72019="WLBLS",
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#' \tabular{ll}{ #' \tabular{ll}{
#' Package: \tab dataRetrieval\cr #' Package: \tab dataRetrieval\cr
#' Type: \tab Package\cr #' Type: \tab Package\cr
#' Version: \tab 2.0.2\cr #' Version: \tab 2.1.1\cr
#' Date: \tab 2014-12-15\cr #' Date: \tab 2015-01-29\cr
#' License: \tab Unlimited for this package, dependencies have more restrictive licensing.\cr #' License: \tab Unlimited for this package, dependencies have more restrictive licensing.\cr
#' Copyright: \tab This software is in the public domain because it contains materials #' Copyright: \tab This software is in the public domain because it contains materials
#' that originally came from the United States Geological Survey, an agency of #' that originally came from the United States Geological Survey, an agency of
......
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
#' @export #' @export
#' @import XML #' @import XML
#' @examples #' @examples
#' \dontrun{
#' siteListPhos <- whatNWISsites(stateCd="OH",parameterCd="00665") #' siteListPhos <- whatNWISsites(stateCd="OH",parameterCd="00665")
#' }
whatNWISsites <- function(...){ whatNWISsites <- function(...){
matchReturn <- list(...) matchReturn <- list(...)
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
\tabular{ll}{ \tabular{ll}{
Package: \tab dataRetrieval\cr Package: \tab dataRetrieval\cr
Type: \tab Package\cr Type: \tab Package\cr
Version: \tab 2.0.2\cr Version: \tab 2.1.1\cr
Date: \tab 2014-12-15\cr Date: \tab 2015-01-29\cr
License: \tab Unlimited for this package, dependencies have more restrictive licensing.\cr License: \tab Unlimited for this package, dependencies have more restrictive licensing.\cr
Copyright: \tab This software is in the public domain because it contains materials Copyright: \tab This software is in the public domain because it contains materials
that originally came from the United States Geological Survey, an agency of that originally came from the United States Geological Survey, an agency of
......
...@@ -23,6 +23,8 @@ endDate <- "2012-10-01" ...@@ -23,6 +23,8 @@ endDate <- "2012-10-01"
offering <- '00003' offering <- '00003'
property <- '00060' property <- '00060'
obs_url <- constructNWISURL(siteNumber,property,startDate,endDate,'dv') obs_url <- constructNWISURL(siteNumber,property,startDate,endDate,'dv')
\dontrun{
rawData <- getWebServiceData(obs_url) rawData <- getWebServiceData(obs_url)
} }
}
...@@ -62,8 +62,9 @@ property <- "00060" ...@@ -62,8 +62,9 @@ property <- "00060"
obs_url <- constructNWISURL(siteNumber,property, obs_url <- constructNWISURL(siteNumber,property,
startDate,endDate,"dv",format="tsv") startDate,endDate,"dv",format="tsv")
data <- importRDB1(obs_url)
\dontrun{ \dontrun{
data <- importRDB1(obs_url)
urlMultiPcodes <- constructNWISURL("04085427",c("00060","00010"), urlMultiPcodes <- constructNWISURL("04085427",c("00060","00010"),
startDate,endDate,"dv",statCd=c("00003","00001"),"tsv") startDate,endDate,"dv",statCd=c("00003","00001"),"tsv")
multiData <- importRDB1(urlMultiPcodes) multiData <- importRDB1(urlMultiPcodes)
......
...@@ -44,16 +44,10 @@ URLmulti <- paste(baseURL, ...@@ -44,16 +44,10 @@ URLmulti <- paste(baseURL,
"statCd=00003", "statCd=00003",
"parameterCd=00060",sep="&") "parameterCd=00060",sep="&")
dataReturnMulti <- importWaterML2(URLmulti) dataReturnMulti <- importWaterML2(URLmulti)
filePath <- system.file("extdata", package="dataRetrieval")
fileName <- "WaterML2Example.xml"
fullPath <- file.path(filePath, fileName)
UserData <- importWaterML2(fullPath)
} }
filePath <- system.file("extdata", package="dataRetrieval") filePath <- system.file("extdata", package="dataRetrieval")
fileName <- "WaterML2Example.xml" fileName <- "WaterML2Example.xml"
fullPath <- file.path(filePath, fileName) fullPath <- file.path(filePath, fileName)
UserData <- importWaterML2(fullPath)
fileData <- importWaterML2(fullPath)
} }
...@@ -61,9 +61,9 @@ siteNumber <- '05114000' ...@@ -61,9 +61,9 @@ siteNumber <- '05114000'
parameterCd <- '00060' parameterCd <- '00060'
startDate <- "2014-10-10" startDate <- "2014-10-10"
endDate <- "2014-10-10" endDate <- "2014-10-10"
# These examples require an internet connection to run
rawData <- readNWISuv(siteNumber,parameterCd,startDate,endDate)
\dontrun{ \dontrun{
rawData <- readNWISuv(siteNumber,parameterCd,startDate,endDate)
timeZoneChange <- readNWISuv(c('04024430','04024000'),parameterCd, timeZoneChange <- readNWISuv(c('04024430','04024000'),parameterCd,
"2013-11-03","2013-11-03") "2013-11-03","2013-11-03")
} }
......
...@@ -65,10 +65,12 @@ The following statistics codes are converted by \code{renameNWISColumns}. See ...@@ -65,10 +65,12 @@ The following statistics codes are converted by \code{renameNWISColumns}. See
siteWithTwo <- '01480015' siteWithTwo <- '01480015'
startDate <- "2012-09-01" startDate <- "2012-09-01"
endDate <- "2012-10-01" endDate <- "2012-10-01"
\dontrun{
url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv') url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv')
twoResults <- importWaterML1(url2,TRUE) twoResults <- importWaterML1(url2,TRUE)
twoResults <- renameNWISColumns(twoResults) twoResults <- renameNWISColumns(twoResults)
} }
}
\seealso{ \seealso{
\code{\link{readNWISdv}}, \code{\link{readNWISuv}} \code{\link{readNWISdv}}, \code{\link{readNWISuv}}
} }
......
...@@ -35,8 +35,10 @@ Arguments to the function should be based on \url{http://waterservices.usgs.gov/ ...@@ -35,8 +35,10 @@ Arguments to the function should be based on \url{http://waterservices.usgs.gov/
Mapper format is used Mapper format is used
} }
\examples{ \examples{
\dontrun{
siteListPhos <- whatNWISsites(stateCd="OH",parameterCd="00665") siteListPhos <- whatNWISsites(stateCd="OH",parameterCd="00665")
} }
}
\keyword{NWIS} \keyword{NWIS}
\keyword{data} \keyword{data}
\keyword{import} \keyword{import}
......
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