diff --git a/DESCRIPTION b/DESCRIPTION index d5de273cd32a588dc124a0a5de9992e3ce9ff050..f619337f84e686e8717860a1062bbef29d8ad046 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -51,7 +51,6 @@ Collate: 'processQWData.r' 'constructNWISURL.r' 'getDataAvailability.r' - 'getMultipleParameterNames.r' 'getWaterML1Data.r' 'padVariable.r' 'getRDB1Data.r' diff --git a/NAMESPACE b/NAMESPACE index 673861ca65f78660da4ba26d94a1e3fc2e68b048..b9206bbe640951f91f1c8c9b8733dd67dc99c519 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,26 +6,25 @@ export(dateFormatCheck) export(formatCheckDate) export(formatCheckParameterCd) export(formatCheckSiteNumber) +export(getDVData) export(getDailyDataFromFile) export(getDataAvailability) export(getDataFromFile) -export(getDVData) export(getMetaData) -export(getMultipleParameterNames) export(getParameterInfo) export(getPreLoadedDailyData) export(getPreLoadedData) export(getPreLoadedSampleData) export(getQWData) export(getQWDataFromFile) -export(getRawQWData) export(getRDB1Data) +export(getRawQWData) +export(getSTORETSampleData) export(getSampleData) export(getSampleDataFromFile) export(getSiteFileData) -export(getSTORETSampleData) -export(getWaterML1Data) export(getWQPData) +export(getWaterML1Data) export(mergeReport) export(padVariable) export(populateConcentrations) diff --git a/R/formatCheckParameterCd.r b/R/formatCheckParameterCd.r index 46f833ec97150ab9c0a9923b20afce95efd0e10c..7187c6975d21ed0b40db6103debc556c41a047ee 100644 --- a/R/formatCheckParameterCd.r +++ b/R/formatCheckParameterCd.r @@ -11,32 +11,34 @@ #' pCode <- '01234' #' formatCheckParameterCd(pCode, interactive = FALSE) formatCheckParameterCd <- function(ParameterCd, interactive=TRUE){ #checks for a 5 digit number - if (nchar(ParameterCd) < 5){ - - padVariable <- function(x,padTo){ - numDigits <- nchar(x) - if (padTo != numDigits){ - leadingZeros <- paste(rep("0",(padTo-numDigits)),collapse="",sep="") - x <- paste(leadingZeros,x,sep="") + + pCodeReturn <- rep(NA,length(ParameterCd)) + index <- 1 + + for (i in ParameterCd){ + + if (nchar(i) < 5){ + if (interactive){ + message("Most USGS parameter codes are 5 digits long, you entered a ", nchar(i), " digit number = ", i , ".\n") + + i <- padVariable(i,5) + message("The following parameter code will be used instead:",i,"\n") + message("If you would like to change the parameter code, enter it here (no quotes), otherwise hit return:\n") + tempParameterCd <- readline() + if (nzchar(tempParameterCd)){ + i <- tempParameterCd + } + } else { + tempText <- padVariable(i,5) + warningMessage <- paste("Most USGS parameter codes are 5 digits long, you entered ", + i , ".\n",tempText," will be used instead", sep="") + warning(warningMessage) + i <- padVariable(i,5) } - return(x) - } - - if (interactive){ - cat("Most USGS parameter codes are 5 digits long, you entered a ", nchar(ParameterCd), "digit number = ", ParameterCd , ".\n") - ParameterCd <- padVariable(ParameterCd,5) - cat("The following parameter code will be used instead:",ParameterCd,"\n") - cat("If you would like to change the parameter code, enter it here (no quotes), otherwise hit return:\n") - tempParameterCd <- readline() - if (nzchar(tempParameterCd)) ParameterCd <- tempParameterCd - } else { - tempText <- padVariable(ParameterCd,5) - warningMessage <- paste("Most USGS parameter codes are 5 digits long, you entered ", - ParameterCd , ".\n",tempText," will be used instead", sep="") - warning(warningMessage) - ParameterCd <- padVariable(ParameterCd,5) - } + } + pCodeReturn[index] <- i + index <- index + 1 } - return(ParameterCd) + return(pCodeReturn) } diff --git a/R/getDataAvailability.r b/R/getDataAvailability.r index cdb117652699a42978bc45cc31a683a29d762afe..526b6a5287389a366cf919a88c4a0944500b6880 100644 --- a/R/getDataAvailability.r +++ b/R/getDataAvailability.r @@ -4,14 +4,13 @@ #' #' @param siteNumber string USGS site number. This is usually an 8 digit number #' @param interactive logical Option for interactive mode. If true, a progress indicator is printed to the console. -#' @param longNames logical indicates whether or not to make a web call to get long names of parameters. Be aware this could take a very long time if the station has lots of data. #' @keywords data import USGS web service #' @return retval dataframe with all information found in the expanded site file #' @export #' @examples #' # These examples require an internet connection to run #' availableData <- getDataAvailability('05114000',interactive=FALSE) -getDataAvailability <- function(siteNumber="",interactive=TRUE, longNames=FALSE){ +getDataAvailability <- function(siteNumber="",interactive=TRUE){ # Checking for 8 digit site ID: siteNumber <- formatCheckSiteNumber(siteNumber,interactive=interactive) @@ -39,11 +38,9 @@ getDataAvailability <- function(siteNumber="",interactive=TRUE, longNames=FALSE) SiteFile$count <- as.numeric(SiteFile$count) pCodes <- unique(SiteFile$parameter_cd) - - if(longNames){ - pcodeINFO <- getMultipleParameterNames(pCodes,interactive) - SiteFile <- merge(SiteFile,pcodeINFO,by="parameter_cd") - } + + pcodeINFO <- getParameterInfo(pCodes,interactive) + SiteFile <- merge(SiteFile,pcodeINFO,by="parameter_cd") return(SiteFile) } diff --git a/R/getMultipleParameterNames.r b/R/getMultipleParameterNames.r deleted file mode 100644 index fa8ff0539ddc4ad1ba407ed0169c065ce38c2358..0000000000000000000000000000000000000000 --- a/R/getMultipleParameterNames.r +++ /dev/null @@ -1,32 +0,0 @@ -#' USGS Mulitple Parameter List -#' -#' Imports a table of information on a set of parameters such as parameter name, units, group, and srs name. -#' Warning! This function can be very slow because an individual web service call has to be made for each parameter. -#' There is currently no way to request multiple parameters from the web service and get the extended information. -#' -#' @param pCodes vector set of 5-digit parameter codes to gather information on -#' @param interactive logical Option for interactive mode. If true, a progress indicator is printed to the console. -#' @keywords data import USGS web service -#' @return retval dataframe with all information found in the expanded site file -#' @export -#' @examples -#' # These examples require an internet connection to run -#' availableData <- getMultipleParameterNames(c("00060", "00065", "00010"),interactive=FALSE) -getMultipleParameterNames <- function(pCodes, interactive=TRUE){ - - numObs <- length(pCodes) - printUpdate <- floor(seq(1,numObs,(numObs-1)/100)) - if(interactive) cat("Percent complete: \n") - for (i in 1:numObs){ - if (1 == i) { - pcodeINFO <- getParameterInfo(pCodes[i]) - } else { - pcodeINFO <- rbind(pcodeINFO, getParameterInfo(pCodes[i])) - } - if(interactive) { - - if(i %in% printUpdate) cat(floor(i*100/numObs),"\t") - } - } - return(pcodeINFO) -} diff --git a/R/getParameterInfo.r b/R/getParameterInfo.r index 87b7b8d5c21ad1853b859912c667d6388450aad0..54babac1e805e4a48ab5476f2ea64f3c9f6badb9 100644 --- a/R/getParameterInfo.r +++ b/R/getParameterInfo.r @@ -3,18 +3,19 @@ #' Imports data from NWIS about meaured parameter based on user-supplied parameter code. #' This function gets the data from here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes} #' -#' @param parameterCd string USGS parameter code. This is usually an 5 digit number. +#' @param parameterCd vector USGS parameter code. This is usually an 5 digit number. #' @param interactive logical Option for interactive mode. If true, there is user interaction for error handling and data checks. #' @keywords data import USGS web service #' @return parameterData dataframe with all information from the USGS about the particular parameter (usually code, name, short name, units, and CAS registry numbers) #' @export #' @examples #' # These examples require an internet connection to run -#' paramINFO <- getParameterInfo('01075') -#' paramINFO2 <- getParameterInfo('00931',interactive=FALSE) +#' paramINFO <- getParameterInfo(c('01075','00060','00931')) getParameterInfo <- function(parameterCd,interactive=TRUE){ parameterCd <- formatCheckParameterCd(parameterCd, interactive=interactive) - urlParameterCd <- paste("http://nwis.waterdata.usgs.gov/nwis/pmcodes/?radio_pm_search=pm_search&pm_search=",parameterCd,"&casrn_search=&srsname_search=&format=rdb_file&show=parameter_group_nm&show=parameter_nm&show=casrn&show=srsname&show=parameter_units",sep="") + + urlParameterCd <- "http://nwis.waterdata.usgs.gov/nwis/pmcodes/pmcodes?radio_pm_search=param_group&pm_group=All+--+include+all+parameter+groups&pm_search=&casrn_search=&srsname_search=&format=rdb&show=parameter_group_nm&show=parameter_nm&show=casrn&show=srsname&show=parameter_units" + parameterCdFile <- read.delim( urlParameterCd, header = TRUE, @@ -24,7 +25,10 @@ getParameterInfo <- function(parameterCd,interactive=TRUE){ colClasses=c('character'), fill = TRUE, comment.char="#") + dataType <- parameterCdFile[1,] + parameterCdFile <- parameterCdFile[-1,] - parameterData <- parameterCdFile[2,] + parameterData <- parameterCdFile[parameterCdFile$parameter_cd %in% parameterCd,] + return(parameterData) } diff --git a/R/populateParameterINFO.r b/R/populateParameterINFO.r index 9bb87787e3e04bcc3fb7bf26f9bfd06e2d4d4ade..75c04c70d64aa913db1ac42184896cae52cacbca 100644 --- a/R/populateParameterINFO.r +++ b/R/populateParameterINFO.r @@ -10,8 +10,8 @@ #' @examples #' #This example requires an internet connection to run #' INFO <- getSiteFileData('01594440') -#' parameterCd <- "00175" -#' parameterData <- getParameterInfo(parameterCd,interactive=interactive) +#' parameterCd <- "01075" +#' parameterData <- getParameterInfo(parameterCd) #' INFO$param.nm <- parameterData$parameter_nm #' INFO$param.units <- parameterData$parameter_units #' INFO$paramShortName <- parameterData$srsname @@ -20,13 +20,13 @@ populateParameterINFO <- function(parameterCd, localINFO=INFO, interactive=TRUE){ if (nzchar(parameterCd)){ if(interactive){ - cat("Your water quality data are for parameter number", localINFO$paramNumber, "which has the name:'", localINFO$param.nm, "'.\n") - cat("Typically you will want a shorter name to be used in graphs and tables. The suggested short name is:'", localINFO$paramShortName, "'.\n") - cat("If you would like to change the short name, enter it here, otherwise just hit enter (no quotes):") + message("Your water quality data are for parameter number", localINFO$paramNumber, "which has the name:'", localINFO$param.nm, "'.\n") + message("Typically you will want a shorter name to be used in graphs and tables. The suggested short name is:'", localINFO$paramShortName, "'.\n") + message("If you would like to change the short name, enter it here, otherwise just hit enter (no quotes):") shortNameTemp <- readline() if (nchar(shortNameTemp)>0) localINFO$paramShortName <- shortNameTemp - cat("The units for the water quality data are: ", localINFO$param.units, ".\n") - cat("It is helpful to set up a constiuent abbreviation when doing multi-constituent studies, enter a unique id (three or four characters should work something like tn or tp or NO3).\nIt is case sensitive. Even if you don't feel you need an abbreviation you need to enter something (no quotes):\n") + message("The units for the water quality data are: ", localINFO$param.units, ".\n") + message("It is helpful to set up a constiuent abbreviation when doing multi-constituent studies, enter a unique id (three or four characters should work something like tn or tp or NO3).\nIt is case sensitive. Even if you don't feel you need an abbreviation you need to enter something (no quotes):\n") localINFO$constitAbbrev <- readline() } else { localINFO$constitAbbrev <- localINFO$paramShortName @@ -34,13 +34,13 @@ populateParameterINFO <- function(parameterCd, localINFO=INFO, interactive=TRUE) } else { if (interactive){ localINFO$paramNumber <- NA - cat("Enter a long name for the water quality data (no quotes):\n") + message("Enter a long name for the water quality data (no quotes):\n") localINFO$param.nm <- readline() - cat("Enter a short name to be used in graphs and tables(no quotes):\n") + message("Enter a short name to be used in graphs and tables(no quotes):\n") localINFO$paramShortName <- readline() - cat("It is helpful to set up a constiuent abbreviation when doing multi-constituent studies, enter a unique id (three or four characters should work something like tn or tp or NO3).\nIt is case sensitive. Even if you don't feel you need an abbreviation you need to enter something (no quotes):\n") + message("It is helpful to set up a constiuent abbreviation when doing multi-constituent studies, enter a unique id (three or four characters should work something like tn or tp or NO3).\nIt is case sensitive. Even if you don't feel you need an abbreviation you need to enter something (no quotes):\n") localINFO$constitAbbrev <- readline() - cat("Enter the units of the water quality data(no quotes):\n") + message("Enter the units of the water quality data(no quotes):\n") localINFO$param.units <- readline() } else { localINFO$paramNumber <- NA diff --git a/inst/doc/dataRetrieval.pdf b/inst/doc/dataRetrieval.pdf index 7eb6feaac178cf04d68409d085b4165d0943d9d6..9c3efd6b32f4a2d216c164cb05d1d4fe3a4e04f8 100644 Binary files a/inst/doc/dataRetrieval.pdf and b/inst/doc/dataRetrieval.pdf differ diff --git a/man/checkStartEndDate.Rd b/man/checkStartEndDate.Rd index aa1aa87150fb5d96f1f4f053fd04972bebad9d9e..892f64cca9c0ad84ad4ad691484ae396ed210d2e 100644 --- a/man/checkStartEndDate.Rd +++ b/man/checkStartEndDate.Rd @@ -26,6 +26,6 @@ startDate <- '1985-01-01' endDate <- '1990-01-01' checkStartEndDate(startDate, endDate, interactive = FALSE) } -\keyword{flow} \keyword{WRTDS} +\keyword{flow} diff --git a/man/compressData.Rd b/man/compressData.Rd index 17d40a4d71f6d04dd298450d5fc90f0746fd515e..92d9134d44d9369c41a427c163d614c96601a8d5 100644 --- a/man/compressData.Rd +++ b/man/compressData.Rd @@ -36,6 +36,6 @@ value3 <- c(3,4,5) dataInput <- data.frame(dateTime, comment1, value1, comment2, value2, comment3, value3, stringsAsFactors=FALSE) compressData(dataInput, interactive=FALSE) } -\keyword{flow} \keyword{WRTDS} +\keyword{flow} diff --git a/man/constructNWISURL.Rd b/man/constructNWISURL.Rd index 33fd4f50b6a1f2c3ba47c4b873c2b0971000bed9..d27f4d78cc64771dabe636f541ce83bf84e2d358 100644 --- a/man/constructNWISURL.Rd +++ b/man/constructNWISURL.Rd @@ -67,9 +67,9 @@ url_qw <- constructNWISURL(siteNumber,c('01075','00029','00453'),startDate,endDa url_wqp <- constructNWISURL(siteNumber,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{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/dataOverview.Rd b/man/dataOverview.Rd index c99da9b50f9d0142972deef2188cd549ca498cfd..6fe56a3ac2930bf546840bcbdb75fea354dadd3f 100644 --- a/man/dataOverview.Rd +++ b/man/dataOverview.Rd @@ -21,8 +21,8 @@ dataOverview(localDaily = exDaily, localSample = exSample) \seealso{ \code{\link{mergeReport}} } -\keyword{data} -\keyword{import} \keyword{USGS} \keyword{WRTDS} +\keyword{data} +\keyword{import} diff --git a/man/dateFormatCheck.Rd b/man/dateFormatCheck.Rd index 99532817221093d2a64e3ce0e6ac8e3e3aabd07b..dd75fee619a69001adad54bba538e9d5980ee496 100644 --- a/man/dateFormatCheck.Rd +++ b/man/dateFormatCheck.Rd @@ -18,6 +18,6 @@ date <- '1985-01-01' dateFormatCheck(date) } -\keyword{flow} \keyword{WRTDS} +\keyword{flow} diff --git a/man/formatCheckDate.Rd b/man/formatCheckDate.Rd index 0bf8637101b5ac2a8f016bcc8faccdc3edac4dfe..64c54b65061785ecf5741d3f1c4eac8c9ac3af0d 100644 --- a/man/formatCheckDate.Rd +++ b/man/formatCheckDate.Rd @@ -27,6 +27,6 @@ Date <- '1985-01-01' dateString <- 'StartDate' formatCheckDate(Date, dateString, interactive = FALSE) } -\keyword{flow} \keyword{WRTDS} +\keyword{flow} diff --git a/man/formatCheckParameterCd.Rd b/man/formatCheckParameterCd.Rd index 086bea0aa058edc05bb1775bf7025433c33b96ee..d1574546ed4940e46494b4c4bbd46bacce0da90e 100644 --- a/man/formatCheckParameterCd.Rd +++ b/man/formatCheckParameterCd.Rd @@ -23,6 +23,6 @@ pCode <- '01234' formatCheckParameterCd(pCode, interactive = FALSE) } -\keyword{flow} \keyword{WRTDS} +\keyword{flow} diff --git a/man/formatCheckSiteNumber.Rd b/man/formatCheckSiteNumber.Rd index 60a912a66d584e466306e309483b57e7a1f38d54..5d8b42cd9e9cb3a8d96bdf4d70ac01ec0fbe8a03 100644 --- a/man/formatCheckSiteNumber.Rd +++ b/man/formatCheckSiteNumber.Rd @@ -22,6 +22,6 @@ site<- '01234567' formatCheckSiteNumber(site, interactive = FALSE) } -\keyword{flow} \keyword{WRTDS} +\keyword{flow} diff --git a/man/getDVData.Rd b/man/getDVData.Rd index 628b925997ac7b8ac0dd502b0cd41c6525d0525a..89c721c68e85843950c7fb0fe53685004d4a2264 100644 --- a/man/getDVData.Rd +++ b/man/getDVData.Rd @@ -57,8 +57,8 @@ Daily <- getDVData('01594440','00060', '1985-01-01', '1985-03-31', interactive=F \code{\link{retrieveNWISData}}, \code{\link{populateDaily}} } -\keyword{data} -\keyword{import} \keyword{USGS} \keyword{WRTDS} +\keyword{data} +\keyword{import} diff --git a/man/getDailyDataFromFile.Rd b/man/getDailyDataFromFile.Rd index 95f1ece41ac37dce3485e090992a4e76fbc70cc5..2c8ded37b9a18f130b42c18ecc9f4d3787a3c696 100644 --- a/man/getDailyDataFromFile.Rd +++ b/man/getDailyDataFromFile.Rd @@ -40,9 +40,9 @@ filePath <- '~/RData/' # Sample format fileName <- 'ChoptankRiverFlow.txt' \dontrun{getDailyDataFromFile(filePath,fileName,separator="\\t")} } +\keyword{USGS} +\keyword{WRTDS} \keyword{data} \keyword{file} \keyword{import} -\keyword{USGS} -\keyword{WRTDS} diff --git a/man/getDataAvailability.Rd b/man/getDataAvailability.Rd index fd9d46033e9e1e6165f538fcf14a54ab1c79bf69..97d8982836502c506edd289ce9441bce879eb365 100644 --- a/man/getDataAvailability.Rd +++ b/man/getDataAvailability.Rd @@ -2,8 +2,7 @@ \alias{getDataAvailability} \title{USGS data availability} \usage{ - getDataAvailability(siteNumber = "", interactive = TRUE, - longNames = FALSE) + getDataAvailability(siteNumber = "", interactive = TRUE) } \arguments{ \item{siteNumber}{string USGS site number. This is @@ -11,11 +10,6 @@ \item{interactive}{logical Option for interactive mode. If true, a progress indicator is printed to the console.} - - \item{longNames}{logical indicates whether or not to make - a web call to get long names of parameters. Be aware this - could take a very long time if the station has lots of - data.} } \value{ retval dataframe with all information found in the @@ -31,9 +25,9 @@ # These examples require an internet connection to run availableData <- getDataAvailability('05114000',interactive=FALSE) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/getMetaData.Rd b/man/getMetaData.Rd index 77a11bcff1f726b0ecde6225df4d5f1b3b21a8fe..fb57f7d818c177f9756645238dada84569867e04 100644 --- a/man/getMetaData.Rd +++ b/man/getMetaData.Rd @@ -39,10 +39,10 @@ # Automatically gets information about site 05114000 and temperature, no interaction with user INFO <- getMetaData('05114000','00010',interactive=FALSE) } +\keyword{USGS} +\keyword{WRTDS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} -\keyword{WRTDS} diff --git a/man/getParameterInfo.Rd b/man/getParameterInfo.Rd index 6344c8980314b462fbeb13a1be1a227e0e06a434..1257391ce87e0e3add4a47f5f38ebeeddbab1f70 100644 --- a/man/getParameterInfo.Rd +++ b/man/getParameterInfo.Rd @@ -5,7 +5,7 @@ getParameterInfo(parameterCd, interactive = TRUE) } \arguments{ - \item{parameterCd}{string USGS parameter code. This is + \item{parameterCd}{vector USGS parameter code. This is usually an 5 digit number.} \item{interactive}{logical Option for interactive mode. @@ -25,12 +25,11 @@ } \examples{ # These examples require an internet connection to run -paramINFO <- getParameterInfo('01075') -paramINFO2 <- getParameterInfo('00931',interactive=FALSE) +paramINFO <- getParameterInfo(c('01075','00060','00931')) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/getPreLoadedDailyData.Rd b/man/getPreLoadedDailyData.Rd index a39fbbe6d2b72f71d83137208ac0c65157e98722..8be9941cee8a1e22b9c42a2f1e1783955a01990b 100644 --- a/man/getPreLoadedDailyData.Rd +++ b/man/getPreLoadedDailyData.Rd @@ -28,7 +28,7 @@ \examples{ Daily <- getPreLoadedDailyData(ChoptankRiverFlow, interactive=FALSE) } +\keyword{WRTDS} \keyword{data} \keyword{import} -\keyword{WRTDS} diff --git a/man/getPreLoadedSampleData.Rd b/man/getPreLoadedSampleData.Rd index 50708517441fb2c28f93936156fd4fd6c024f9c7..1e8834a400df76773c56f0d66f2f281f4bffabf2 100644 --- a/man/getPreLoadedSampleData.Rd +++ b/man/getPreLoadedSampleData.Rd @@ -23,7 +23,7 @@ \examples{ Sample <- getPreLoadedSampleData(ChoptankRiverNitrate, interactive=FALSE) } +\keyword{WRTDS} \keyword{data} \keyword{import} -\keyword{WRTDS} diff --git a/man/getQWData.Rd b/man/getQWData.Rd index f38d6a2322478fb8c29957201f772fe36d05034b..8348de8d5e2cd018928e1498e8d0ce37842488d7 100644 --- a/man/getQWData.Rd +++ b/man/getQWData.Rd @@ -46,9 +46,9 @@ rawProcessedSample <- getQWData('01594440','01075', '1985-01-01', '1985-03-31') rawProcessedSampleAll <- getQWData('05114000','', '1985-01-01', '1985-03-31') rawProcessedSampleSelect <- getQWData('05114000','00915;00931', '1985-01-01', '1985-04-30', interactive=FALSE) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/getRawQWData.Rd b/man/getRawQWData.Rd index a77fc37ffda4adb1e1bc2c75b3a3a5b26ab57a98..738023e62faec1f5e19e3f7973eb04b875e5d7d0 100644 --- a/man/getRawQWData.Rd +++ b/man/getRawQWData.Rd @@ -45,9 +45,9 @@ rawSample <- getRawQWData('01594440','01075', '1985-01-01', '1985-03-31') rawSampleAll <- getRawQWData('05114000','', '1985-01-01', '1985-03-31') rawSampleSelect <- getRawQWData('05114000',c('00915','00931'), '1985-01-01', '1985-04-30', interactive=FALSE) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/getSTORETSampleData.Rd b/man/getSTORETSampleData.Rd index bf115a32d65fe766b3623eb8288a6201789f0691..a1fc936e537dcb5235c44d9582da57eb0dad1fa3 100644 --- a/man/getSTORETSampleData.Rd +++ b/man/getSTORETSampleData.Rd @@ -44,8 +44,8 @@ Sample_All <- getSTORETSampleData('WIDNR_WQX-10032762','Specific conductance', ' \code{\link{compressData}}, \code{\link{populateSampleColumns}} } -\keyword{data} -\keyword{import} \keyword{USGS} \keyword{WRTDS} +\keyword{data} +\keyword{import} diff --git a/man/getSampleData.Rd b/man/getSampleData.Rd index 782b13c6c3bf602196a178982319a1be56c4f766..f8fc6db8dd5b2a7f164977fe2e1c287b8eefcb84 100644 --- a/man/getSampleData.Rd +++ b/man/getSampleData.Rd @@ -46,8 +46,8 @@ Sample_Select <- getSampleData('05114000','00915;00931', '', '', interactive=FAL \code{\link{compressData}}, \code{\link{populateSampleColumns}} } -\keyword{data} -\keyword{import} \keyword{USGS} \keyword{WRTDS} +\keyword{data} +\keyword{import} diff --git a/man/getSampleDataFromFile.Rd b/man/getSampleDataFromFile.Rd index 34a0e31df6f8ab4745627cbc5afc3f4ea08c175f..f295b54c36bbffe76ecd4934edde2f67b6531f51 100644 --- a/man/getSampleDataFromFile.Rd +++ b/man/getSampleDataFromFile.Rd @@ -35,9 +35,9 @@ filePath <- '~/RData/' # Sample format fileName <- 'ChoptankRiverNitrate.csv' #Sample <- getSampleDataFromFile(filePath,fileName, separator=";",interactive=FALSE) } +\keyword{USGS} +\keyword{WRTDS} \keyword{data} \keyword{file} \keyword{import} -\keyword{USGS} -\keyword{WRTDS} diff --git a/man/getSiteFileData.Rd b/man/getSiteFileData.Rd index 53291b62e542ee7599124ff7866c16c95ed96e9a..37a7d14a54aa31799bcb74be2ebf6e8137323eac 100644 --- a/man/getSiteFileData.Rd +++ b/man/getSiteFileData.Rd @@ -24,9 +24,9 @@ # These examples require an internet connection to run siteINFO <- getSiteFileData('05114000',interactive=FALSE) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/getWQPData.Rd b/man/getWQPData.Rd index 3f5c8e143044f445ad8c2d9c19f888cfaba54b7e..a3b275d477aa664bc684d798eb3b33d64ddcf9f5 100644 --- a/man/getWQPData.Rd +++ b/man/getWQPData.Rd @@ -43,9 +43,9 @@ getWQPData('USGS-01594440','Chloride', '', '') getWQPData('WIDNR_WQX-10032762','Specific conductance', '', '') } +\keyword{WQP} \keyword{data} \keyword{import} \keyword{service} \keyword{web} -\keyword{WQP} diff --git a/man/mergeReport.Rd b/man/mergeReport.Rd index 800f34ba5ab6684f1af1975045caad09cf96f825..5efff9d3878cddc49ca7a82527a2ece4d08a4f52 100644 --- a/man/mergeReport.Rd +++ b/man/mergeReport.Rd @@ -33,8 +33,8 @@ Sample <- mergeReport(interactive=FALSE) \code{\link{getDVData}}, \code{\link{populateSampleColumns}} } -\keyword{data} -\keyword{import} \keyword{USGS} \keyword{WRTDS} +\keyword{data} +\keyword{import} diff --git a/man/padVariable.Rd b/man/padVariable.Rd index 90a166777c47ab504c3c3adc55d3c3197f6b284b..cf3aee545f2616faa1b17dcc20135c43ea3b97f8 100644 --- a/man/padVariable.Rd +++ b/man/padVariable.Rd @@ -20,9 +20,9 @@ pCode <- '10' correctPCode <- padVariable(pCode,5) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/populateDaily.Rd b/man/populateDaily.Rd index e59aafb215c75061b4ac028d2c5a414956f109af..5722f563c0cd546c3c1cb92f01026ffb4690c6a3 100644 --- a/man/populateDaily.Rd +++ b/man/populateDaily.Rd @@ -33,6 +33,6 @@ Daily <- populateDaily(dataInput, 2, interactive=FALSE) \author{ Robert M. Hirsch \email{rhirsch@usgs.gov} } -\keyword{flow} \keyword{WRTDS} +\keyword{flow} diff --git a/man/populateParameterINFO.Rd b/man/populateParameterINFO.Rd index 452eefbe294604f352f12e6a3edf6b1af5fe58c6..bcc0acb9ce87acb77333428a1d5dfa000a5111f8 100644 --- a/man/populateParameterINFO.Rd +++ b/man/populateParameterINFO.Rd @@ -25,8 +25,8 @@ \examples{ #This example requires an internet connection to run INFO <- getSiteFileData('01594440') -parameterCd <- "00175" -parameterData <- getParameterInfo(parameterCd,interactive=interactive) +parameterCd <- "01075" +parameterData <- getParameterInfo(parameterCd) INFO$param.nm <- parameterData$parameter_nm INFO$param.units <- parameterData$parameter_units INFO$paramShortName <- parameterData$srsname diff --git a/man/processQWData.Rd b/man/processQWData.Rd index d5cc07572769a86d41ddf0ae9eb1f8082b06b5f6..660c8bb571bcef093ad463a30d4d779727da1c13 100644 --- a/man/processQWData.Rd +++ b/man/processQWData.Rd @@ -25,9 +25,9 @@ rawSample <- getRawQWData('01594440','01075', '1985-01-01', '1985-03-31') rawSampleSelect <- processQWData(rawSample) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/retrieveNWISData.Rd b/man/retrieveNWISData.Rd index b89cdc3f54ea94944af390a7bc25324665d843d3..8d7ce45c0360d221dbd8763fce7246cdd8c34e95 100644 --- a/man/retrieveNWISData.Rd +++ b/man/retrieveNWISData.Rd @@ -60,9 +60,9 @@ rawDailyTemperature <- retrieveNWISData(siteNumber,'00010', startDate, endDate, rawDailyTemperatureTSV <- retrieveNWISData(siteNumber,'00010', startDate, endDate, StatCd='00001',format="tsv",interactive=FALSE) rawDailyQAndTempMeanMax <- retrieveNWISData(siteNumber,c('00010','00060'), startDate, endDate, StatCd=c('00001','00003'), interactive=FALSE) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/retrieveNWISqwData.Rd b/man/retrieveNWISqwData.Rd index 4e5a169e402d4b4af02344a248be66f16508e587..254045c748b2520c03b207a717b6a2034639f995 100644 --- a/man/retrieveNWISqwData.Rd +++ b/man/retrieveNWISqwData.Rd @@ -44,9 +44,9 @@ data$dateTime <- as.Date(data$dateTime) compressedData <- compressData(data, interactive=interactive) Sample <- populateSampleColumns(compressedData) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/man/retrieveUnitNWISData.Rd b/man/retrieveUnitNWISData.Rd index 5109fd5c8445500f8d94be6fc46c11ef87c2bbe2..f69c1294191c97249a6426057aab6a3daa315659 100644 --- a/man/retrieveUnitNWISData.Rd +++ b/man/retrieveUnitNWISData.Rd @@ -54,9 +54,9 @@ EndDate <- as.character(Sys.Date()) rawData <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate,interactive=FALSE) rawData2 <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate,"tsv",interactive=FALSE) } +\keyword{USGS} \keyword{data} \keyword{import} \keyword{service} -\keyword{USGS} \keyword{web} diff --git a/vignettes/dataRetrieval-concordance.tex b/vignettes/dataRetrieval-concordance.tex index fe9fdbd77dd8e9cc51ed0ba557cb0cd2b2a7c46d..01bedc0b2020a711a149b2b72d000e6f9e94a837 100644 --- a/vignettes/dataRetrieval-concordance.tex +++ b/vignettes/dataRetrieval-concordance.tex @@ -1,9 +1,9 @@ \Sconcordance{concordance:dataRetrieval.tex:dataRetrieval.Rnw:% 1 49 1 55 0 1 6 11 1 1 5 41 1 10 0 16 1 9 0 21 1 5 0 % -6 1 8 0 14 1 14 0 24 1 11 0 15 1 6 0 16 1 10 0 5 1 8 % -0 20 1 5 0 16 1 4 0 21 1 10 0 20 1 5 0 4 1 18 0 29 1 % -9 0 10 1 10 0 14 1 21 0 19 1 5 0 19 1 5 0 17 1 8 0 14 % -1 15 0 16 1 5 0 9 1 5 0 62 1 6 0 14 1 17 0 36 1 5 0 % -24 1 5 0 20 1 38 0 13 1 10 0 22 1 5 0 5 1 14 0 10 1 5 % -0 7 1 5 0 16 1 51 0 15 1 49 0 7 1 32 0 26 1 25 0 8 1 % -5 0 56 1} +6 1 8 0 14 1 42 0 17 1 4 0 15 1 6 0 16 1 10 0 5 1 8 0 % +20 1 5 0 16 1 4 0 21 1 10 0 20 1 5 0 4 1 18 0 29 1 9 % +0 10 1 10 0 14 1 21 0 19 1 5 0 19 1 5 0 17 1 8 0 14 1 % +15 0 16 1 5 0 9 1 5 0 62 1 6 0 14 1 17 0 36 1 5 0 24 % +1 5 0 20 1 38 0 13 1 10 0 22 1 5 0 5 1 13 0 10 1 5 0 % +7 1 5 0 16 1 51 0 15 1 49 0 7 1 32 0 24 1 19 0 8 1 5 % +0 56 1} diff --git a/vignettes/dataRetrieval.Rnw b/vignettes/dataRetrieval.Rnw index 2169659dd6ab108f52b88574bda6c689cf7cbcf1..82de5232f8cb84cf72abb2dde05ba3ecbd508326 100644 --- a/vignettes/dataRetrieval.Rnw +++ b/vignettes/dataRetrieval.Rnw @@ -171,7 +171,7 @@ head(ChoptankAvailableData) There is an additional argument to the getDataAvailability called longNames, which defaults to FALSE. Setting longNames to TRUE will cause the function to make a web service call for each parameter and return expanded information on that parameter. Currently, this is a very slow process because each parameter code makes a unique web service call. If the site does not have many measured parameters, setting longNames to TRUE is reasonable. -It is also possible to only request parameter information for a subset of variables. In the following example, we retrieve just the daily mean parameter information from the Choptank data availability dataframe (excluding all unit value and water quality values). getMultipleParameterNames is the function that is embedded in the getDataAvailability, but here can be used as a standalone function. +It is also possible to only request parameter information for a subset of variables. In the following example, we retrieve just the daily mean parameter information from the Choptank data availability dataframe (excluding all unit value and water quality values). <<getSiteExtended, echo=TRUE>>= @@ -184,13 +184,6 @@ ChoptankDailyData <- subset(ChoptankAvailableData, ChoptankDailyData <- subset(ChoptankDailyData, "00003" == statCd) -#Now, make a call to get all of the parameter information: -pCodeINFO <- getMultipleParameterNames( - ChoptankDailyData$parameter_cd) - -#Merge the available dataframes: -ChoptankDailyData <- merge(ChoptankDailyData, - pCodeINFO,by="parameter_cd") @ <<tablegda, echo=FALSE,results='asis'>>= @@ -720,8 +713,6 @@ There are a few steps that are required in order to create a table in a Microsof availableData <- getDataAvailability(siteNumber) dailyData <- availableData["dv" == availableData$service,] dailyData <- dailyData["00003" == dailyData$statCd,] -pCodeINFO <- getMultipleParameterNames(dailyData$parameter_cd) -dailyData <- merge(dailyData,pCodeINFO, by="parameter_cd") tableData <- with(dailyData, data.frame( diff --git a/vignettes/dataRetrieval.log b/vignettes/dataRetrieval.log index 1092d83676d9dbbfc8164b7f374ceaee90041791..4002811f19e51483ba099632eeb9fcadfbf46a4b 100644 --- a/vignettes/dataRetrieval.log +++ b/vignettes/dataRetrieval.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2012.1.6) 9 JUL 2013 17:05 +This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2012.1.6) 1 AUG 2013 16:23 entering extended mode **dataRetrieval.tex (D:\LADData\RCode\dataRetrieval\vignettes\dataRetrieval.tex @@ -539,32 +539,74 @@ Overfull \hbox (43.87282pt too wide) in paragraph at lines 235--236 Package color Info: Redefining color shadecolor on input line 245. +Overfull \hbox (57.81561pt too wide) in paragraph at lines 287--287 +[] \OT1/pcr/m/n +/10.95 parameter_nm[] + [] + + +Overfull \hbox (57.81561pt too wide) in paragraph at lines 287--287 +[]\OT1/pcr/m/n/10.95 1 Location in cross section, distance from right bank loo +king upstream, feet[] + [] + + +Overfull \hbox (57.81561pt too wide) in paragraph at lines 287--287 +[]\OT1/pcr/m/n/10.95 2 + Stream width, feet[] + [] + + +Overfull \hbox (57.81561pt too wide) in paragraph at lines 287--287 +[]\OT1/pcr/m/n/10.95 3 Sampl +e accounting number[] + [] + + +Overfull \hbox (57.81561pt too wide) in paragraph at lines 287--287 +[]\OT1/pcr/m/n/10.95 4 Location in cross section, distance from left bank looki +ng downstream, feet[] + [] + + +Overfull \hbox (57.81561pt too wide) in paragraph at lines 287--287 +[]\OT1/pcr/m/n/10.95 5 Temperature, wat +er, degrees Celsius[] + [] + + +Overfull \hbox (57.81561pt too wide) in paragraph at lines 287--287 +[]\OT1/pcr/m/n/10.95 6 Temperature, wat +er, degrees Celsius[] + [] + + Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [4] -Package color Info: Redefining color shadecolor on input line 270. +Package color Info: Redefining color shadecolor on input line 298. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [5] -Package color Info: Redefining color shadecolor on input line 330. -Package color Info: Redefining color shadecolor on input line 348. +Package color Info: Redefining color shadecolor on input line 344. +Package color Info: Redefining color shadecolor on input line 362. -Overfull \hbox (30.64148pt too wide) in paragraph at lines 358--359 +Overfull \hbox (30.64148pt too wide) in paragraph at lines 372--373 []\OT1/ptm/m/n/10.95 Parameter in-for-ma-tion is ob-tained from []$\OT1/pcr/m/n /10.95 http : / / nwis . waterdata . usgs . gov / nwis / pmcodes/$[] [] -Package color Info: Redefining color shadecolor on input line 369. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [6] -Package color Info: Redefining color shadecolor on input line 389. -Package color Info: Redefining color shadecolor on input line 409. +Package color Info: Redefining color shadecolor on input line 383. +Package color Info: Redefining color shadecolor on input line 403. +Package color Info: Redefining color shadecolor on input line 423. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] @@ -572,67 +614,71 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [7] LaTeX Warning: No positions in optional float specifier. - Default added (so using `tbp') on input line 426. + Default added (so using `tbp') on input line 440. <figure/getNWIStemperaturePlot.pdf, id=213, 505.89pt x 505.89pt> File: figure/getNWIStemperaturePlot.pdf Graphic file (type pdf) <use figure/getNWIStemperaturePlot.pdf> Package pdftex.def Info: figure/getNWIStemperaturePlot.pdf used on input line 4 -28. +42. (pdftex.def) Requested size: 448.07928pt x 448.07928pt. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[8 <D:/LADData/RCode/dataRetrieval/vignettes/figure/getNWIStemperaturePlot.pdf> +[8] +Overfull \vbox (21.68121pt too high) has occurred while \output is active [] + + +[9 <D:/LADData/RCode/dataRetrieval/vignettes/figure/getNWIStemperaturePlot.pdf> ] -Package color Info: Redefining color shadecolor on input line 447. Package color Info: Redefining color shadecolor on input line 461. +Package color Info: Redefining color shadecolor on input line 475. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[9] -Package color Info: Redefining color shadecolor on input line 497. -Package color Info: Redefining color shadecolor on input line 522. +[10] +Package color Info: Redefining color shadecolor on input line 511. +Package color Info: Redefining color shadecolor on input line 536. LaTeX Warning: No positions in optional float specifier. - Default added (so using `tbp') on input line 531. + Default added (so using `tbp') on input line 545. -<figure/getQWtemperaturePlot.pdf, id=233, 505.89pt x 505.89pt> +<figure/getQWtemperaturePlot.pdf, id=237, 505.89pt x 505.89pt> File: figure/getQWtemperaturePlot.pdf Graphic file (type pdf) <use figure/getQWtemperaturePlot.pdf> -Package pdftex.def Info: figure/getQWtemperaturePlot.pdf used on input line 533 +Package pdftex.def Info: figure/getQWtemperaturePlot.pdf used on input line 547 . (pdftex.def) Requested size: 448.07378pt x 448.07928pt. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[10] +[11] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[11 <D:/LADData/RCode/dataRetrieval/vignettes/figure/getQWtemperaturePlot.pdf>] +[12 <D:/LADData/RCode/dataRetrieval/vignettes/figure/getQWtemperaturePlot.pdf>] -Overfull \hbox (50.793pt too wide) in paragraph at lines 546--547 +Overfull \hbox (50.793pt too wide) in paragraph at lines 560--561 \OT1/ptm/m/n/10.95 There are ad-di-tional data sets avail-able on the Wa-ter Qu al-ity Data Por-tal ([]$\OT1/pcr/m/n/10.95 http : / / www . waterqualitydata .$ [] -Package color Info: Redefining color shadecolor on input line 549. -LaTeX Font Info: Try loading font information for TS1+pcr on input line 551. +Package color Info: Redefining color shadecolor on input line 563. +LaTeX Font Info: Try loading font information for TS1+pcr on input line 565. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\ts1pcr.fd" File: ts1pcr.fd 2001/06/04 font definitions for TS1/pcr. ) -Package color Info: Redefining color shadecolor on input line 584. +Package color Info: Redefining color shadecolor on input line 598. -Overfull \hbox (5.25568pt too wide) in paragraph at lines 593--593 +Overfull \hbox (5.25568pt too wide) in paragraph at lines 607--607 []\OT1/pcr/m/n/10.95 url_uv <- []\OT1/pcr/b/n/10.95 constructNWISURL[]\OT1/pcr/ m/n/10.95 (siteNumber,[]"00060"[],startDate,endDate,[]\TS1/pcr/m/n/10.95 '\OT1/ pcr/m/n/10.95 uv\TS1/pcr/m/n/10.95 '[]\OT1/pcr/m/n/10.95 )[] @@ -642,21 +688,17 @@ pcr/m/n/10.95 uv\TS1/pcr/m/n/10.95 '[]\OT1/pcr/m/n/10.95 )[] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[12] -Package color Info: Redefining color shadecolor on input line 614. -Package color Info: Redefining color shadecolor on input line 633. - -Overfull \vbox (21.68121pt too high) has occurred while \output is active [] - - [13] -Package color Info: Redefining color shadecolor on input line 688. -Package color Info: Redefining color shadecolor on input line 701. +Package color Info: Redefining color shadecolor on input line 628. +Package color Info: Redefining color shadecolor on input line 647. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [14] +Package color Info: Redefining color shadecolor on input line 702. +Package color Info: Redefining color shadecolor on input line 715. + Overfull \vbox (21.68121pt too high) has occurred while \output is active [] @@ -665,35 +707,39 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [16] -Package color Info: Redefining color shadecolor on input line 790. - Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [17] -Package color Info: Redefining color shadecolor on input line 841. -LaTeX Font Info: Try loading font information for OMS+pcr on input line 846. +Package color Info: Redefining color shadecolor on input line 804. + +Overfull \vbox (21.68121pt too high) has occurred while \output is active [] + + +[18] +Package color Info: Redefining color shadecolor on input line 855. +LaTeX Font Info: Try loading font information for OMS+pcr on input line 860. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\omspcr.fd" File: omspcr.fd ) LaTeX Font Info: Font shape `OMS/pcr/m/n' in size <10.95> not available -(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 846. +(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 860. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[18] -Package color Info: Redefining color shadecolor on input line 870. -Package color Info: Redefining color shadecolor on input line 890. +[19] +Package color Info: Redefining color shadecolor on input line 884. +Package color Info: Redefining color shadecolor on input line 904. -Overfull \hbox (44.67563pt too wide) in paragraph at lines 915--915 +Overfull \hbox (44.67563pt too wide) in paragraph at lines 929--929 [] \OT1/pcr/m/n/10.95 First day of the discharge record is 2000-01-01 and last day is 2013-01-01[] [] -Overfull \hbox (44.67563pt too wide) in paragraph at lines 915--915 +Overfull \hbox (44.67563pt too wide) in paragraph at lines 929--929 [] \OT1/pcr/m/n/10.95 The first sample is from 2000-01-04 and the last sample i s from 2012-12-18[] [] @@ -702,127 +748,128 @@ s from 2012-12-18[] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[19] -Package color Info: Redefining color shadecolor on input line 947. +[20] +Package color Info: Redefining color shadecolor on input line 961. LaTeX Warning: No positions in optional float specifier. - Default added (so using `tbp') on input line 953. + Default added (so using `tbp') on input line 967. -<figure/egretEx.pdf, id=294, 505.89pt x 505.89pt> +<figure/egretEx.pdf, id=298, 505.89pt x 505.89pt> File: figure/egretEx.pdf Graphic file (type pdf) <use figure/egretEx.pdf> -Package pdftex.def Info: figure/egretEx.pdf used on input line 955. +Package pdftex.def Info: figure/egretEx.pdf used on input line 969. (pdftex.def) Requested size: 448.07378pt x 448.07928pt. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[20] +[21] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[21 <D:/LADData/RCode/dataRetrieval/vignettes/figure/egretEx.pdf>] -Package color Info: Redefining color shadecolor on input line 981. -Package color Info: Redefining color shadecolor on input line 991. -Package color Info: Redefining color shadecolor on input line 1014. +[22 <D:/LADData/RCode/dataRetrieval/vignettes/figure/egretEx.pdf>] +Package color Info: Redefining color shadecolor on input line 995. +Package color Info: Redefining color shadecolor on input line 1005. -Overfull \hbox (90.66557pt too wide) in paragraph at lines 1017--1017 +Overfull \hbox (51.24562pt too wide) in paragraph at lines 1016--1016 +[] \OT1/pcr/m/n/10.95 Sample1 <- localSample[!duplicated(localSample[c("DecYea +r","ConcHigh")]),][] + [] + +Package color Info: Redefining color shadecolor on input line 1027. + +Overfull \hbox (90.66557pt too wide) in paragraph at lines 1030--1030 [][]\OT1/pcr/b/n/10.95 install.packages[]\OT1/pcr/m/n/10.95 ([]"dataRetrieval"[ ], repos=[]"http://usgs-r.github.com"[], type=[]"source"[])[] [] -Overfull \hbox (157.60596pt too wide) in paragraph at lines 1023--1024 +Overfull \hbox (157.60596pt too wide) in paragraph at lines 1036--1037 \OT1/ptm/m/n/10.95 C:/Users/userA/Documents/R/win-library/2.15/dataRetrieval, a nd the de-fault for a Mac: /Users/userA/Library/R/2.15/library/dataRetrieval. [] +Package color Info: Redefining color shadecolor on input line 1040. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[22 +[23 ] -Package color Info: Redefining color shadecolor on input line 1027. - Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[23] +[24] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[24] +[25] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[25 +[26 ] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[26] +[27] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[27 +[28 ] -Package color Info: Redefining color shadecolor on input line 1214. -Package color Info: Redefining color shadecolor on input line 1260. +Package color Info: Redefining color shadecolor on input line 1227. +Package color Info: Redefining color shadecolor on input line 1265. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[28 +[29 ] -Overfull \hbox (11.82567pt too wide) in paragraph at lines 1278--1278 +Overfull \hbox (11.82567pt too wide) in paragraph at lines 1283--1283 []\OT1/pcr/m/n/10.95 Suspended sediment concentration (SSC) 1980-10-01 1991-09- 30 3651 mg/l[] [] -<table1.png, id=344, 554.07pt x 125.71968pt> +<table1.png, id=348, 554.07pt x 125.71968pt> File: table1.png Graphic file (type png) <use table1.png> -Package pdftex.def Info: table1.png used on input line 1297. +Package pdftex.def Info: table1.png used on input line 1302. (pdftex.def) Requested size: 554.06865pt x 125.71936pt. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[29] -Overfull \vbox (21.68121pt too high) has occurred while \output is active [] - - [30 <D:/LADData/RCode/dataRetrieval/vignettes/table1.png>] -Underfull \hbox (badness 1983) in paragraph at lines 1313--1314 +Underfull \hbox (badness 1983) in paragraph at lines 1318--1319 []\OT1/ptm/m/n/10.95 Hirsch, R. M., Moyer, D. L. and Arch-field, S. A. (2010), Weighted Re-gres-sions on [] -Underfull \hbox (badness 1221) in paragraph at lines 1313--1314 +Underfull \hbox (badness 1221) in paragraph at lines 1318--1319 \OT1/ptm/m/n/10.95 Time, Dis-charge, and Sea-son (WRTDS), with an Ap-pli-ca-tio n to Chesa-peake Bay River [] -Underfull \hbox (badness 2443) in paragraph at lines 1313--1314 +Underfull \hbox (badness 2443) in paragraph at lines 1318--1319 \OT1/ptm/m/n/10.95 In-puts. JAWRA Jour-nal of the Amer-i-can Wa-ter Re-sources As-so-ci-a-tion, 46: 857-880. [] -Underfull \hbox (badness 3690) in paragraph at lines 1313--1314 +Underfull \hbox (badness 3690) in paragraph at lines 1318--1319 \OT1/ptm/m/n/10.95 doi: 10.1111/j.1752-1688.2010.00482.x []$\OT1/pcr/m/n/10.95 http : / / onlinelibrary . wiley . com / doi /$ [] -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1320. +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1325. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] @@ -830,10 +877,10 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [31 ] -Package atveryend Info: Empty hook `AfterLastShipout' on input line 1320. +Package atveryend Info: Empty hook `AfterLastShipout' on input line 1325. (D:\LADData\RCode\dataRetrieval\vignettes\dataRetrieval.aux) -Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1320. -Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1320. +Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1325. +Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1325. Package rerunfilecheck Info: File `dataRetrieval.out' has not changed. (rerunfilecheck) Checksum: E39EB3526BB75384BBF16131BFA2BB3D;2017. @@ -841,7 +888,7 @@ Package rerunfilecheck Info: File `dataRetrieval.out' has not changed. Here is how much of TeX's memory you used: 8255 strings out of 494045 123288 string characters out of 3145961 - 215571 words of memory out of 3000000 + 216572 words of memory out of 3000000 11328 multiletter control sequences out of 15000+200000 30364 words of font info for 66 fonts, out of 3000000 for 9000 715 hyphenation exceptions out of 8191 @@ -854,7 +901,7 @@ les (x86)/MiKTeX 2.9/fonts/type1/urw/courier/ucrb8a.pfb><C:/Program Files (x86) .9/fonts/type1/urw/times/utmb8a.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/ty pe1/urw/times/utmr8a.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/urw/tim es/utmri8a.pfb> -Output written on dataRetrieval.pdf (31 pages, 274927 bytes). +Output written on dataRetrieval.pdf (31 pages, 274754 bytes). PDF statistics: 425 PDF objects out of 1000 (max. 8388607) 88 named destinations out of 1000 (max. 500000) diff --git a/vignettes/dataRetrieval.pdf b/vignettes/dataRetrieval.pdf index 7eb6feaac178cf04d68409d085b4165d0943d9d6..9c3efd6b32f4a2d216c164cb05d1d4fe3a4e04f8 100644 Binary files a/vignettes/dataRetrieval.pdf and b/vignettes/dataRetrieval.pdf differ diff --git a/vignettes/dataRetrieval.synctex.gz b/vignettes/dataRetrieval.synctex.gz index 2b021e507f4a98141b5909267508569df1d907a4..afdb961fab745cec75a2b4700d648096d1b1a811 100644 Binary files a/vignettes/dataRetrieval.synctex.gz and b/vignettes/dataRetrieval.synctex.gz differ diff --git a/vignettes/dataRetrieval.tex b/vignettes/dataRetrieval.tex index b0283212200c0638510bab29c163df71333b2ea7..4248bde759bed6ac0665bec36b8635eb607641c1 100644 --- a/vignettes/dataRetrieval.tex +++ b/vignettes/dataRetrieval.tex @@ -148,7 +148,7 @@ Not every station will measure all parameters. A short list of commonly measured % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:04:58 2013 +% Thu Aug 01 16:23:09 2013 \begin{table}[ht] \centering \begin{tabular}{rll} @@ -174,7 +174,7 @@ For real-time data, the parameter code and site ID will suffice. For most varia Some common stat codes are shown in Table \ref{tab:stat}. % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:04:58 2013 +% Thu Aug 01 16:23:09 2013 \begin{table}[ht] \centering \begin{tabular}{rll} @@ -250,12 +250,40 @@ ChoptankAvailableData <- \hlfunctioncall{getDataAvailability}(siteNumber) \end{alltt} \begin{verbatim} parameter_cd statCd startDate endDate count service -2 00010 00001 1988-10-01 2012-05-09 894 dv -3 00010 00002 2010-10-01 2012-05-09 529 dv -4 00010 00003 2010-10-01 2012-05-09 529 dv -5 00060 00003 1948-01-01 2013-07-08 23930 dv -6 00095 00001 2010-10-01 2012-05-09 527 dv -7 00095 00002 2010-10-01 2012-05-09 527 dv +1 00001 1974-11-04 1984-08-01 109 qw +2 00004 2013-03-27 2013-03-27 1 qw +3 00008 1972-10-24 1973-12-26 12 qw +4 00009 1974-03-22 1974-03-22 1 qw +5 00010 00001 1988-10-01 2012-05-09 894 dv +6 00010 00002 2010-10-01 2012-05-09 529 dv + parameter_group_nm +1 Information +2 Physical +3 Information +4 Information +5 Physical +6 Physical + parameter_nm +1 Location in cross section, distance from right bank looking upstream, feet +2 Stream width, feet +3 Sample accounting number +4 Location in cross section, distance from left bank looking downstream, feet +5 Temperature, water, degrees Celsius +6 Temperature, water, degrees Celsius + casrn srsname +1 +2 Instream features, est. stream width +3 +4 +5 Temperature, water +6 Temperature, water + parameter_units +1 ft +2 ft +3 nu +4 ft +5 deg C +6 deg C \end{verbatim} \end{kframe} \end{knitrout} @@ -263,7 +291,7 @@ ChoptankAvailableData <- \hlfunctioncall{getDataAvailability}(siteNumber) There is an additional argument to the getDataAvailability called longNames, which defaults to FALSE. Setting longNames to TRUE will cause the function to make a web service call for each parameter and return expanded information on that parameter. Currently, this is a very slow process because each parameter code makes a unique web service call. If the site does not have many measured parameters, setting longNames to TRUE is reasonable. -It is also possible to only request parameter information for a subset of variables. In the following example, we retrieve just the daily mean parameter information from the Choptank data availability dataframe (excluding all unit value and water quality values). getMultipleParameterNames is the function that is embedded in the getDataAvailability, but here can be used as a standalone function. +It is also possible to only request parameter information for a subset of variables. In the following example, we retrieve just the daily mean parameter information from the Choptank data availability dataframe (excluding all unit value and water quality values). \begin{knitrout} @@ -277,27 +305,13 @@ ChoptankDailyData <- \hlfunctioncall{subset}(ChoptankAvailableData, \hlcomment{# This pulls out the mean:} ChoptankDailyData <- \hlfunctioncall{subset}(ChoptankDailyData, \hlstring{"00003"} == statCd) - -\hlcomment{#Now, make a call to get all of the parameter information:} -pCodeINFO <- \hlfunctioncall{getMultipleParameterNames}( - ChoptankDailyData$parameter_cd) -\end{alltt} -\begin{verbatim} -Percent complete: -20 40 60 80 100 -\end{verbatim} -\begin{alltt} - -\hlcomment{#Merge the available dataframes:} -ChoptankDailyData <- \hlfunctioncall{merge}(ChoptankDailyData, - pCodeINFO,by=\hlstring{"parameter_cd"}) \end{alltt} \end{kframe} \end{knitrout} % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:05:04 2013 +% Thu Aug 01 16:23:12 2013 \begin{table}[ht] \centering \begin{tabular}{rlllll} @@ -305,7 +319,7 @@ ChoptankDailyData <- \hlfunctioncall{merge}(ChoptankDailyData, & shortName & Start & End & Count & Units \\ \hline 1 & Temperature, water & 2010-10-01 & 2012-05-09 & 529 & deg C \\ - 2 & Stream flow, mean. daily & 1948-01-01 & 2013-07-08 & 23930 & cfs \\ + 2 & Stream flow, mean. daily & 1948-01-01 & 2013-07-31 & 23954 & cfs \\ 3 & Specific conductance & 2010-10-01 & 2012-05-09 & 527 & uS/cm @25C \\ 4 & Suspended sediment concentration (SSC) & 1980-10-01 & 1991-09-30 & 3651 & mg/l \\ 5 & Suspended sediment discharge & 1980-10-01 & 1991-09-30 & 3652 & tons/day \\ @@ -510,8 +524,8 @@ dissolvedNitrateSimple <- \hlfunctioncall{getQWData}(siteNumber, parameterCd, \hlfunctioncall{names}(dissolvedNitrateSimple) \end{alltt} \begin{verbatim} -[1] "dateTime" "qualifier.00618" "value.00618" -[4] "qualifier.71851" "value.71851" +[1] "dateTime" "qualifier.71851" "value.71851" +[4] "qualifier.00618" "value.00618" \end{verbatim} \end{kframe} \end{knitrout} @@ -648,7 +662,7 @@ There are 4750 data points, and 4750 days. Details of the Daily dataframe are listed below: % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:05:13 2013 +% Thu Aug 01 16:23:22 2013 \begin{table}[ht] \centering \begin{tabular}{rllll} @@ -757,7 +771,7 @@ As an example to understand how the dataRetrieval package handles a more complex \begin{center} % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:05:14 2013 +% Thu Aug 01 16:23:24 2013 \begin{table}[ht] \centering \begin{tabular}{rllrlrlr} @@ -993,11 +1007,10 @@ To see the raw code for a particular code, type the name of the function: removeDuplicates \end{alltt} \begin{verbatim} -function (localSample = Sample) -{ - Sample1 <- localSample[!duplicated(localSample[c("DecYear", - "ConcHigh")]), ] - return(Sample1) +function(localSample=Sample) { + Sample1 <- localSample[!duplicated(localSample[c("DecYear","ConcHigh")]),] + + return(Sample1) } <environment: namespace:dataRetrieval> \end{verbatim} @@ -1043,7 +1056,7 @@ After installing the package, you need to open the library each time you re-star %------------------------------------------------------------ % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:05:17 2013 +% Thu Aug 01 16:23:26 2013 \begin{table}[ht] \centering \begin{tabular}{rl} @@ -1109,7 +1122,7 @@ After installing the package, you need to open the library each time you re-star There are 62 columns returned from the water quality portal. % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:05:17 2013 +% Thu Aug 01 16:23:26 2013 \begin{table}[ht] \centering \begin{tabular}{rl} @@ -1166,7 +1179,7 @@ There are 62 columns returned from the water quality portal. \FloatBarrier % latex table generated in R 3.0.1 by xtable 1.7-1 package -% Tue Jul 09 17:05:17 2013 +% Thu Aug 01 16:23:26 2013 \begin{table}[ht] \centering \begin{tabular}{rl} @@ -1216,14 +1229,6 @@ There are a few steps that are required in order to create a table in a Microsof availableData <- \hlfunctioncall{getDataAvailability}(siteNumber) dailyData <- availableData[\hlstring{"dv"} == availableData$service,] dailyData <- dailyData[\hlstring{"00003"} == dailyData$statCd,] -pCodeINFO <- \hlfunctioncall{getMultipleParameterNames}(dailyData$parameter_cd) -\end{alltt} -\begin{verbatim} -Percent complete: -20 40 60 80 100 -\end{verbatim} -\begin{alltt} -dailyData <- \hlfunctioncall{merge}(dailyData,pCodeINFO, by=\hlstring{"parameter_cd"}) tableData <- \hlfunctioncall{with}(dailyData, \hlfunctioncall{data.frame}( @@ -1244,7 +1249,7 @@ tableData 5 Suspended sediment discharge 1980-10-01 End Count Units 1 2012-05-09 529 deg C -2 2013-07-08 23930 cfs +2 2013-07-31 23954 cfs 3 2012-05-09 527 uS/cm @25C 4 1991-09-30 3651 mg/l 5 1991-09-30 3652 tons/day diff --git a/vignettes/dataRetrieval.toc b/vignettes/dataRetrieval.toc index 593cd4b711193cdf22204a59c323b8df3be5b26f..54560ac37c5af160b8f024d258a5a100c3fe0985 100644 --- a/vignettes/dataRetrieval.toc +++ b/vignettes/dataRetrieval.toc @@ -6,25 +6,25 @@ \contentsline {subsubsection}{\numberline {2.2.1}getSiteFileData}{4}{subsubsection.2.2.1} \contentsline {subsubsection}{\numberline {2.2.2}getDataAvailability}{4}{subsubsection.2.2.2} \contentsline {subsection}{\numberline {2.3}Parameter Information}{6}{subsection.2.3} -\contentsline {subsection}{\numberline {2.4}Daily Values}{6}{subsection.2.4} -\contentsline {subsection}{\numberline {2.5}Unit Values}{9}{subsection.2.5} -\contentsline {subsection}{\numberline {2.6}Water Quality Values}{10}{subsection.2.6} -\contentsline {subsection}{\numberline {2.7}STORET Water Quality Retrievals}{12}{subsection.2.7} -\contentsline {subsection}{\numberline {2.8}URL Construction}{12}{subsection.2.8} -\contentsline {section}{\numberline {3}Data Retrievals Structured For Use In The EGRET Package}{13}{section.3} -\contentsline {subsection}{\numberline {3.1}INFO Data}{13}{subsection.3.1} -\contentsline {subsection}{\numberline {3.2}Daily Data}{13}{subsection.3.2} -\contentsline {subsection}{\numberline {3.3}Sample Data}{14}{subsection.3.3} -\contentsline {subsection}{\numberline {3.4}Censored Values: Summation Explanation}{16}{subsection.3.4} -\contentsline {subsection}{\numberline {3.5}User-Generated Data Files}{17}{subsection.3.5} -\contentsline {subsubsection}{\numberline {3.5.1}getDailyDataFromFile}{17}{subsubsection.3.5.1} -\contentsline {subsubsection}{\numberline {3.5.2}getSampleDataFromFile}{18}{subsubsection.3.5.2} -\contentsline {subsection}{\numberline {3.6}Merge Report}{19}{subsection.3.6} -\contentsline {subsection}{\numberline {3.7}EGRET Plots}{20}{subsection.3.7} -\contentsline {section}{\numberline {A}Getting Started in R}{22}{appendix.A} -\contentsline {subsection}{\numberline {A.1}New to R?}{22}{subsection.A.1} -\contentsline {subsection}{\numberline {A.2}R User: Installing dataRetrieval}{22}{subsection.A.2} -\contentsline {section}{\numberline {B}Columns Names}{23}{appendix.B} -\contentsline {subsection}{\numberline {B.1}INFO dataframe}{23}{subsection.B.1} -\contentsline {subsection}{\numberline {B.2}Water Quality Portal}{25}{subsection.B.2} -\contentsline {section}{\numberline {C}Creating tables in Microsoft from R}{28}{appendix.C} +\contentsline {subsection}{\numberline {2.4}Daily Values}{7}{subsection.2.4} +\contentsline {subsection}{\numberline {2.5}Unit Values}{10}{subsection.2.5} +\contentsline {subsection}{\numberline {2.6}Water Quality Values}{11}{subsection.2.6} +\contentsline {subsection}{\numberline {2.7}STORET Water Quality Retrievals}{13}{subsection.2.7} +\contentsline {subsection}{\numberline {2.8}URL Construction}{13}{subsection.2.8} +\contentsline {section}{\numberline {3}Data Retrievals Structured For Use In The EGRET Package}{14}{section.3} +\contentsline {subsection}{\numberline {3.1}INFO Data}{14}{subsection.3.1} +\contentsline {subsection}{\numberline {3.2}Daily Data}{14}{subsection.3.2} +\contentsline {subsection}{\numberline {3.3}Sample Data}{15}{subsection.3.3} +\contentsline {subsection}{\numberline {3.4}Censored Values: Summation Explanation}{17}{subsection.3.4} +\contentsline {subsection}{\numberline {3.5}User-Generated Data Files}{18}{subsection.3.5} +\contentsline {subsubsection}{\numberline {3.5.1}getDailyDataFromFile}{18}{subsubsection.3.5.1} +\contentsline {subsubsection}{\numberline {3.5.2}getSampleDataFromFile}{19}{subsubsection.3.5.2} +\contentsline {subsection}{\numberline {3.6}Merge Report}{20}{subsection.3.6} +\contentsline {subsection}{\numberline {3.7}EGRET Plots}{21}{subsection.3.7} +\contentsline {section}{\numberline {A}Getting Started in R}{23}{appendix.A} +\contentsline {subsection}{\numberline {A.1}New to R?}{23}{subsection.A.1} +\contentsline {subsection}{\numberline {A.2}R User: Installing dataRetrieval}{23}{subsection.A.2} +\contentsline {section}{\numberline {B}Columns Names}{24}{appendix.B} +\contentsline {subsection}{\numberline {B.1}INFO dataframe}{24}{subsection.B.1} +\contentsline {subsection}{\numberline {B.2}Water Quality Portal}{26}{subsection.B.2} +\contentsline {section}{\numberline {C}Creating tables in Microsoft from R}{29}{appendix.C} diff --git a/vignettes/figure/egretEx.pdf b/vignettes/figure/egretEx.pdf index efd8a55131e54b8ad4032d0e048ff3ec1ec506e5..abea195b57302f3f31613fec67458ca0ba9e306f 100644 Binary files a/vignettes/figure/egretEx.pdf and b/vignettes/figure/egretEx.pdf differ diff --git a/vignettes/figure/getNWIStemperaturePlot.pdf b/vignettes/figure/getNWIStemperaturePlot.pdf index ea0c96ca3deae2dc8253445af51022e597d89ecf..9ed9ce86f465f8b9e72fa78b6e7c4544bfc3b4b0 100644 Binary files a/vignettes/figure/getNWIStemperaturePlot.pdf and b/vignettes/figure/getNWIStemperaturePlot.pdf differ diff --git a/vignettes/figure/getQWtemperaturePlot.pdf b/vignettes/figure/getQWtemperaturePlot.pdf index 8bc9e080752cb35d76d42e58c28e67b563fd854d..dd10677a2b3c7827775300fbbc193066db98cb9c 100644 Binary files a/vignettes/figure/getQWtemperaturePlot.pdf and b/vignettes/figure/getQWtemperaturePlot.pdf differ