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