diff --git a/.Rbuildignore b/.Rbuildignore index 7e70442af354c0d67ff2e431f4a07198375c819e..bd20a11e8772462c4eb790fb74c39199b758c545 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,4 +11,5 @@ ^\.Rproj\.Rhistory ^\.Rproj\.travis.yml ^\.Rproj\appveyor.yml +appveyor.yml diff --git a/DESCRIPTION b/DESCRIPTION index b046f2d21dda6ca416597843f8a5262c54eb2760..add1aba42d722027884c47d3056d5311cc2f87f6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: dataRetrieval Type: Package Title: Retrieval functions for hydrologic data -Version: 1.4.1.9000 -Date: 2014-10-06 +Version: 1.4.0 +Date: 2014-10-13 Authors@R: c( person("Robert", "Hirsch", role = c("aut"), email = "rhirsch@usgs.gov"), person("Laura", "DeCicco", role = c("aut","cre"), @@ -21,7 +21,6 @@ Imports: zoo, XML, RCurl, - dplyr, reshape2, lubridate Suggests: diff --git a/R/getRDB1Data.r b/R/getRDB1Data.r index c1a470edb85fd8b99557530efb4e1752c871ec55..7f9bd732a255ff9f828700db20b1e665f2f10e25 100644 --- a/R/getRDB1Data.r +++ b/R/getRDB1Data.r @@ -12,16 +12,16 @@ #' siteNumber <- "02177000" #' startDate <- "2012-09-01" #' endDate <- "2012-10-01" -#' offering <- '00003' -#' property <- '00060' +#' offering <- "00003" +#' property <- "00060" #' obs_url <- constructNWISURL(siteNumber,property, -#' startDate,endDate,'dv',format='tsv') +#' startDate,endDate,"dv",format="tsv") #' data <- getRDB1Data(obs_url) #' urlMulti <- constructNWISURL("04085427",c("00060","00010"), -#' startDate,endDate,'dv',statCd=c("00003","00001"),'tsv') +#' startDate,endDate,"dv",statCd=c("00003","00001"),"tsv") #' multiData <- getRDB1Data(urlMulti) #' unitDataURL <- constructNWISURL(siteNumber,property, -#' as.character(Sys.Date()),as.character(Sys.Date()),'uv',format='tsv') +#' "2014-10-10","2014-10-10","uv",format="tsv") #' unitData <- getRDB1Data(unitDataURL, asDateTime=TRUE) getRDB1Data <- function(obs_url,asDateTime=FALSE, qw=FALSE){ diff --git a/R/getWaterML1Data.r b/R/getWaterML1Data.r index f136e27068cd9f1f8ae02581cba2ac6ae7b4fabc..e33814f59939f0921a14c2f4efc4b7d1e7cf5558 100644 --- a/R/getWaterML1Data.r +++ b/R/getWaterML1Data.r @@ -26,7 +26,7 @@ #' startGW,endGW, service="gwlevels", format="xml",interactive=FALSE) #' groundWater <- getWaterML1Data(groundwaterExampleURL) #' unitDataURL <- constructNWISURL(siteNumber,property, -#' as.character(Sys.Date()),as.character(Sys.Date()),'uv',format='xml') +#' "2014-10-10","2014-10-10",'uv',format='xml') #' unitData <- getWaterML1Data(unitDataURL) getWaterML1Data <- function(obs_url){ diff --git a/R/renameColumns.R b/R/renameColumns.R index 21c8968859b94c8d7c47f474830ce1a5f9bbdd04..cff16c8f4b37ac712b58b07d4ce51a32296affcc 100644 --- a/R/renameColumns.R +++ b/R/renameColumns.R @@ -12,9 +12,10 @@ #' rawData <- getNWISdvData(siteNumber,c("00010","00060","00300"), #' "2001-01-01","2002-01-01",statCd=c("00001","00003")) #' rawData <- renameColumns(rawData) -#' today <- as.character(Sys.Date()) -#' rawData2 <- getNWISunitData(siteNumber,c("00010","00060"),today,today) +#' date <- "2014-10-10" +#' rawData2 <- getNWISunitData(siteNumber,c("00010","00060"),date,date) #' rawData2 <- renameColumns(rawData2) +#' head(rawData2) renameColumns <- function(rawData){ columnNames <- names(rawData) diff --git a/R/retrieveUnitNWISData.r b/R/retrieveUnitNWISData.r index 67decc8296f57b31b47a996bdcb3b0f5f1732d75..2969337d5abfed6f1903bf54b765816b7a5af9ad 100644 --- a/R/retrieveUnitNWISData.r +++ b/R/retrieveUnitNWISData.r @@ -18,11 +18,13 @@ #' @examples #' siteNumber <- '05114000' #' parameterCd <- '00060' -#' startDate <- as.character(Sys.Date()) -#' endDate <- as.character(Sys.Date()) +#' startDate <- "2014-10-10" +#' endDate <- "2014-10-10" #' # These examples require an internet connection to run #' rawData <- getNWISunitData(siteNumber,parameterCd,startDate,endDate) +#' summary(rawData) #' rawData2 <- getNWISunitData(siteNumber,parameterCd,startDate,endDate,"tsv") +#' summary(rawData2) getNWISunitData <- function (siteNumber,parameterCd,startDate,endDate,format="xml",interactive=TRUE){ url <- constructNWISURL(siteNumber,parameterCd,startDate,endDate,"uv",format=format,interactive=interactive) diff --git a/man/getNWISunitData.Rd b/man/getNWISunitData.Rd index f0d1416cdd63ccace34ea69978c44797486f3163..0f23fbf2623d5814f72235538a928cbc3870c277 100644 --- a/man/getNWISunitData.Rd +++ b/man/getNWISunitData.Rd @@ -32,11 +32,13 @@ A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov \examples{ siteNumber <- '05114000' parameterCd <- '00060' -startDate <- as.character(Sys.Date()) -endDate <- as.character(Sys.Date()) +startDate <- "2014-10-10" +endDate <- "2014-10-10" # These examples require an internet connection to run rawData <- getNWISunitData(siteNumber,parameterCd,startDate,endDate) +summary(rawData) rawData2 <- getNWISunitData(siteNumber,parameterCd,startDate,endDate,"tsv") +summary(rawData2) } \keyword{USGS} \keyword{data} diff --git a/man/getRDB1Data.Rd b/man/getRDB1Data.Rd index 1856b749c91802ac16f0615f955280e54085cb44..674e5526b0dbc20a0ce20ecc5b101c0d2fd2d5e6 100644 --- a/man/getRDB1Data.Rd +++ b/man/getRDB1Data.Rd @@ -23,16 +23,16 @@ NWIS site, parameter code, statistic, startdate and enddate. siteNumber <- "02177000" startDate <- "2012-09-01" endDate <- "2012-10-01" -offering <- '00003' -property <- '00060' +offering <- "00003" +property <- "00060" obs_url <- constructNWISURL(siteNumber,property, - startDate,endDate,'dv',format='tsv') + startDate,endDate,"dv",format="tsv") data <- getRDB1Data(obs_url) urlMulti <- constructNWISURL("04085427",c("00060","00010"), - startDate,endDate,'dv',statCd=c("00003","00001"),'tsv') + startDate,endDate,"dv",statCd=c("00003","00001"),"tsv") multiData <- getRDB1Data(urlMulti) unitDataURL <- constructNWISURL(siteNumber,property, - as.character(Sys.Date()),as.character(Sys.Date()),'uv',format='tsv') + "2014-10-10","2014-10-10","uv",format="tsv") unitData <- getRDB1Data(unitDataURL, asDateTime=TRUE) } diff --git a/man/getWaterML1Data.Rd b/man/getWaterML1Data.Rd index 4284dfbf438cde0afbd036293ba96acef4f7401d..7006273119494caed77535ef526b3ab564ec4024 100644 --- a/man/getWaterML1Data.Rd +++ b/man/getWaterML1Data.Rd @@ -34,7 +34,7 @@ groundwaterExampleURL <- constructNWISURL(groundWaterSite, NA, startGW,endGW, service="gwlevels", format="xml",interactive=FALSE) groundWater <- getWaterML1Data(groundwaterExampleURL) unitDataURL <- constructNWISURL(siteNumber,property, - as.character(Sys.Date()),as.character(Sys.Date()),'uv',format='xml') + "2014-10-10","2014-10-10",'uv',format='xml') unitData <- getWaterML1Data(unitDataURL) } diff --git a/man/renameColumns.Rd b/man/renameColumns.Rd index 6b58cdf27c11f916da655e84f9c3db645b62d93d..bb8142710aa3bc48ae68038414d67a2800e7367c 100644 --- a/man/renameColumns.Rd +++ b/man/renameColumns.Rd @@ -20,9 +20,10 @@ siteNumber <- '05114000' rawData <- getNWISdvData(siteNumber,c("00010","00060","00300"), "2001-01-01","2002-01-01",statCd=c("00001","00003")) rawData <- renameColumns(rawData) -today <- as.character(Sys.Date()) -rawData2 <- getNWISunitData(siteNumber,c("00010","00060"),today,today) +date <- "2014-10-10" +rawData2 <- getNWISunitData(siteNumber,c("00010","00060"),date,date) rawData2 <- renameColumns(rawData2) +head(rawData2) } \keyword{USGS} \keyword{data}