diff --git a/DESCRIPTION b/DESCRIPTION index 30925fcbb8a41824dbd0c09758037f9d16116c8c..b2c8a69f22f63a5ad12640fc331ec8b58acaaf18 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: dataRetrieval Type: Package Title: Retrieval functions for hydrologic data Version: 1.3.3 -Date: 2014-08-04 +Date: 2014-09-12 Author: Robert M. Hirsch, Laura De Cicco Maintainer: Laura De Cicco <ldecicco@usgs.gov> Description: Collection of functions to help retrieve USGS data from either web diff --git a/NAMESPACE b/NAMESPACE index ae86ab235dd98080bc95ce3978f1aa0f677a25ee..f1d2b6d2a24a646aa5a176b6dfe5be2b2e29933b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2 (4.0.2): do not edit by hand +export(basicWQPData) export(checkStartEndDate) export(compressData) export(constructNWISURL) diff --git a/R/basicWQPData.R b/R/basicWQPData.R new file mode 100644 index 0000000000000000000000000000000000000000..d23328a53c16eb7089c6db8b234bf284ead38176 --- /dev/null +++ b/R/basicWQPData.R @@ -0,0 +1,111 @@ +#' Basic Water Quality Portal Data grabber +#' +#' Imports data from the Water Quality Portal based on a specified url. +#' +#' @param url string URL to Water Quality Portal#' @keywords data import USGS web service +#' @return retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for +#' start and end times. +#' @export +#' @import RCurl +#' @examples +#' # These examples require an internet connection to run +#' rawSampleURL <- constructNWISURL('USGS-01594440','01075', '1985-01-01', '1985-03-31',"wqp") +#' rawSample <- basicWQPData(rawSampleURL) +basicWQPData <- function(url){ + + h <- basicHeaderGatherer() + + retval = tryCatch({ + doc <- getURL(url, headerfunction = h$update) + + }, warning = function(w) { + message(paste("URL caused a warning:", url)) + message(w) + }, error = function(e) { + message(paste("URL does not seem to exist:", url)) + message(e) + return(NA) + }) + + if(h$value()["Content-Type"] == "text/tab-separated-values;charset=UTF-8"){ + + numToBeReturned <- as.numeric(h$value()["Total-Result-Count"]) + + if (!is.na(numToBeReturned) | numToBeReturned != 0){ + + + namesData <- read.delim(textConnection(doc), header = TRUE, quote="\"", + dec=".", sep='\t', + colClasses='character', + fill = TRUE,nrow=1) + classColumns <- setNames(rep('character',ncol(namesData)),names(namesData)) + classColumns["ActivityStartDate"] <- "Date" + + classColumns[grep("MeasureValue",names(classColumns))] <- NA + + retval <- read.delim(textConnection(doc), header = TRUE, quote="\"", + dec=".", sep='\t', + colClasses=as.character(classColumns), + fill = TRUE) + actualNumReturned <- nrow(retval) + + retval[,names(which(sapply(retval[,grep("MeasureValue",names(retval))], function(x)all(is.na(x)))))] <- "" + + if(actualNumReturned != numToBeReturned) warning(numToBeReturned, " sample results were expected, ", actualNumReturned, " were returned") + + timeZoneLibrary <- setNames(c("America/New_York","America/New_York","America/Chicago","America/Chicago", + "America/Denver","America/Denver","America/Los_Angeles","America/Los_Angeles", + "America/Anchorage","America/Anchorage","America/Honolulu","America/Honolulu"), + c("EST","EDT","CST","CDT","MST","MDT","PST","PDT","AKST","AKDT","HAST","HST")) + timeZoneStart <- as.character(timeZoneLibrary[retval$ActivityStartTime.TimeZoneCode]) + timeZoneEnd <- as.character(timeZoneLibrary[retval$ActivityEndTime.TimeZoneCode]) + + if(any(!is.na(timeZoneStart))){ + if(length(unique(timeZoneStart)) == 1){ + retval$ActivityStartDateTime <- with(retval, as.POSIXct(paste(ActivityStartDate, ActivityStartTime.Time),format="%Y-%m-%d %H:%M:%S", tz=unique(timeZoneStart))) + } else { + warning("Mixed time zone information") + if(any(is.na(timeZoneStart))){ + warning("Missing time zone information, all dateTimes default to user's local time") + retval$ActivityStartDateTime <- with(retval, as.POSIXct(paste(ActivityStartDate, ActivityStartTime.Time), format="%Y-%m-%d %H:%M:%S"),tz=Sys.timezone()) + } else { + for(i in seq_along(row.names(retval))){ + timeZone <- timeZoneStart[i] + retval$ActivityStartDateTime[i] <- with(retval, as.POSIXct(paste(ActivityStartDate[i], ActivityStartTime.Time[i]), format="%Y-%m-%d %H:%M:%S",tz=timeZone)) + } + } + } + } + + if(any(!is.na(timeZoneEnd))){ + if(length(unique(timeZoneEnd)) == 1){ + retval$ActivityEndDateTime <- with(retval, as.POSIXct(paste(ActivityEndDate, ActivityEndTime.Time), format="%Y-%m-%d %H:%M:%S",tz=unique(timeZoneEnd))) + } else { + warning("Mixed time zone information") + if(any(is.na(timeZoneEnd))){ + warning("Missing time zone information, all dateTimes default to user's local time") + retval$ActivityEndDateTime <- with(retval, as.POSIXct(paste(ActivityEndDate, ActivityEndTime.Time), format="%Y-%m-%d %H:%M:%S"), tz=Sys.timezone()) + } else { + for(i in seq_along(row.names(retval))){ + retval$ActivityEndDateTime[i] <- with(retval, as.POSIXct(paste(ActivityEndDate[i], ActivityEndTime.Time[i]), format="%Y-%m-%d %H:%M:%S",tz=timeZoneEnd[i])) + } + } + } + } + + if(any(retval$ActivityEndDate != "")){ + retval$ActivityEndDate <- as.Date(retval$ActivityEndDate) + } + + return(retval) + + } else { + warning("No data to retrieve") + return(NA) + } + } else { + message(paste("URL caused an error:", url)) + message("Content-Type=",h$value()["Content-Type"]) + return(NA) + } +} \ No newline at end of file diff --git a/R/getGeneralWQPData.R b/R/getGeneralWQPData.R index 3e7eb95f47316200c8cf590a0a79a4f1ed01bcf0..4faf41f2c250cf3e906b59b797fecb8d151b30a2 100644 --- a/R/getGeneralWQPData.R +++ b/R/getGeneralWQPData.R @@ -30,45 +30,7 @@ getGeneralWQPData <- function(...){ urlCall <- paste(baseURL, urlCall, "&mimeType=tsv",sep = "") - - doc = tryCatch({ - h <- basicHeaderGatherer() - doc <- getURL(urlCall, headerfunction = h$update) - - }, warning = function(w) { - message(paste("URL caused a warning:", urlCall)) - message(w) - }, error = function(e) { - message(paste("URL does not seem to exist:", urlCall)) - message(e) - return(NA) - }) - - if(h$value()["Content-Type"] == "text/tab-separated-values;charset=UTF-8"){ - - numToBeReturned <- as.numeric(h$value()["Total-Result-Count"]) - - if (!is.na(numToBeReturned) | numToBeReturned != 0){ - retval <- read.delim(textConnection(doc), header = TRUE, quote="\"", - dec=".", sep='\t', - colClasses=c('character'), - fill = TRUE) - - actualNumReturned <- nrow(retval) - - if(actualNumReturned != numToBeReturned) warning(numToBeReturned, " sample results were expected, ", actualNumReturned, " were returned") - - return(retval) - } else { - warning(paste("No data to retrieve from",urlCall)) - return(NA) - } - - } else { - message(paste("URL caused an error:", urlCall)) - message("Content-Type=",h$value()["Content-Type"]) - return(NA) - } - + retVal <- basicWQPData(urlCall) + return(retVal) } \ No newline at end of file diff --git a/R/getRawQWData.r b/R/getRawQWData.r index 3b748d0bf2a6cb0b489cc10ed9477c047ba4820d..a491059d3a909188ab2980205bb766376c2070f3 100644 --- a/R/getRawQWData.r +++ b/R/getRawQWData.r @@ -1,17 +1,16 @@ -#' Raw Data Import for USGS NWIS Water Quality Data +#' Raw Data Import for Water Quality Portal #' -#' Imports data from NWIS web service. This function gets the data from here: \url{http://www.waterqualitydata.us} -#' A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} -#' A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table} +#' Imports data from the Water Quality Portal. This function gets the data from here: \url{http://www.waterqualitydata.us} #' -#' @param siteNumber string USGS site number. This is usually an 8 digit number -#' @param 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. +#' @param siteNumber string site number. This needs to include the full agency code prefix. +#' @param 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. #' @param startDate string starting date for data retrieval in the form YYYY-MM-DD. #' @param endDate string ending date for data retrieval in the form YYYY-MM-DD. #' @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 retval dataframe with first column dateTime, and at least one qualifier and value columns -#' (subsequent qualifier/value columns could follow depending on requested parameter codes) +#' @return retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for +#' start and end times. #' @export #' @import RCurl #' @examples @@ -23,44 +22,7 @@ retrieveWQPqwData <- function(siteNumber,parameterCd,startDate,endDate,interactive=TRUE){ url <- constructNWISURL(siteNumber,parameterCd,startDate,endDate,"wqp",interactive=interactive) - - retval = tryCatch({ - h <- basicHeaderGatherer() - doc <- getURL(url, headerfunction = h$update) - - }, warning = function(w) { - message(paste("URL caused a warning:", url)) - message(w) - }, error = function(e) { - message(paste("URL does not seem to exist:", url)) - message(e) - return(NA) - }) - - if(h$value()["Content-Type"] == "text/tab-separated-values;charset=UTF-8"){ - - numToBeReturned <- as.numeric(h$value()["Total-Result-Count"]) - - if (!is.na(numToBeReturned) | numToBeReturned != 0){ - - retval <- read.delim(textConnection(doc), header = TRUE, quote="\"", - dec=".", sep='\t', - colClasses=c('character'), - fill = TRUE) - actualNumReturned <- nrow(retval) - - if(actualNumReturned != numToBeReturned) warning(numToBeReturned, " sample results were expected, ", actualNumReturned, " were returned") - - return(retval) - - } else { - warning("No data to retrieve") - return(NA) - } - } else { - message(paste("URL caused an error:", url)) - message("Content-Type=",h$value()["Content-Type"]) - return(NA) - } + retVal <- basicWQPData(url) + return(retVal) } diff --git a/R/processQWData.r b/R/processQWData.r index 2779b108d6647559f381bab592affd327e030d01..e6f696f98135e6eb1540056d3b93a8d6e1055e4e 100644 --- a/R/processQWData.r +++ b/R/processQWData.r @@ -24,7 +24,7 @@ processQWData <- function(data,pCode=TRUE){ test <- data.frame(data$USGSPCode) # test$dateTime <- as.POSIXct(strptime(paste(data$ActivityStartDate,data$ActivityStartTime.Time,sep=" "), "%Y-%m-%d %H:%M:%S")) - test$dateTime <- as.Date(data$ActivityStartDate, "%Y-%m-%d") + test$dateTime <- data$ActivityStartDate originalLength <- nrow(test) test$qualifier <- qualifier diff --git a/man/basicWQPData.Rd b/man/basicWQPData.Rd new file mode 100644 index 0000000000000000000000000000000000000000..d7a1768157e0ff9094822ed6de9e8454db8f551d --- /dev/null +++ b/man/basicWQPData.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2 (4.0.2): do not edit by hand +\name{basicWQPData} +\alias{basicWQPData} +\title{Basic Water Quality Portal Data grabber} +\usage{ +basicWQPData(url) +} +\arguments{ +\item{url}{string URL to Water Quality Portal#'} +} +\value{ +retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for +start and end times. +} +\description{ +Imports data from the Water Quality Portal based on a specified url. +} +\examples{ +# These examples require an internet connection to run +rawSampleURL <- constructNWISURL('USGS-01594440','01075', '1985-01-01', '1985-03-31',"wqp") +rawSample <- basicWQPData(rawSampleURL) +} +\keyword{USGS} +\keyword{data} +\keyword{import} +\keyword{service} +\keyword{web} + diff --git a/man/retrieveWQPqwData.Rd b/man/retrieveWQPqwData.Rd index 79b0c0ce34dc4d7c02a7b4c9c89a42ba46e16888..e79341e04b5daae51c77f0178278bec9fcf3ed9b 100644 --- a/man/retrieveWQPqwData.Rd +++ b/man/retrieveWQPqwData.Rd @@ -1,15 +1,16 @@ % Generated by roxygen2 (4.0.2): do not edit by hand \name{retrieveWQPqwData} \alias{retrieveWQPqwData} -\title{Raw Data Import for USGS NWIS Water Quality Data} +\title{Raw Data Import for Water Quality Portal} \usage{ retrieveWQPqwData(siteNumber, parameterCd, startDate, endDate, interactive = TRUE) } \arguments{ -\item{siteNumber}{string USGS site number. This is usually an 8 digit number} +\item{siteNumber}{string site number. This needs to include the full agency code prefix.} -\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{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.} @@ -18,13 +19,11 @@ retrieveWQPqwData(siteNumber, parameterCd, startDate, endDate, \item{interactive}{logical Option for interactive mode. If true, there is user interaction for error handling and data checks.} } \value{ -retval dataframe with first column dateTime, and at least one qualifier and value columns -(subsequent qualifier/value columns could follow depending on requested parameter codes) +retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for +start and end times. } \description{ -Imports data from NWIS web service. This function gets the data from here: \url{http://www.waterqualitydata.us} -A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} -A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table} +Imports data from the Water Quality Portal. This function gets the data from here: \url{http://www.waterqualitydata.us} } \examples{ # These examples require an internet connection to run diff --git a/vignettes/dataRetrieval-concordance.tex b/vignettes/dataRetrieval-concordance.tex index 736487217ae60d1ed15be3ce99edb7b45484af60..a7ff1f2180c6f5c1817cd311b3d1af91dd01f43c 100644 --- a/vignettes/dataRetrieval-concordance.tex +++ b/vignettes/dataRetrieval-concordance.tex @@ -2,8 +2,8 @@ 1 126 1 49 0 1 7 15 1 1 14 55 1 3 0 36 1 2 0 11 1 24 % 0 24 1 3 0 23 1 3 0 6 1 7 0 18 1 3 0 25 1 1 0 17 1 9 % 0 6 1 7 0 21 1 8 0 16 1 2 0 11 1 23 0 21 1 9 0 20 1 3 % -0 6 1 17 0 27 1 10 0 11 1 10 0 15 1 13 0 21 1 4 0 21 % -1 4 0 17 1 7 0 22 1 8 0 19 1 4 0 9 1 4 0 78 1 1 2 9 1 % -1 4 4 1 20 0 44 1 4 0 32 1 4 0 21 1 4 0 21 1 37 0 13 % -1 9 0 94 1 4 0 9 1 13 0 13 1 4 0 14 1 4 0 5 1 4 0 23 % -1 18 0 8 1 4 0 55 1} +0 6 1 17 0 27 1 6 0 11 1 9 0 15 1 12 0 19 1 4 0 21 1 % +4 0 17 1 7 0 22 1 8 0 19 1 4 0 9 1 4 0 78 1 1 2 9 1 1 % +4 4 1 20 0 44 1 4 0 32 1 4 0 21 1 4 0 21 1 37 0 13 1 % +9 0 94 1 4 0 9 1 13 0 13 1 4 0 14 1 4 0 5 1 4 0 23 1 % +18 0 8 1 4 0 55 1} diff --git a/vignettes/dataRetrieval.Rnw b/vignettes/dataRetrieval.Rnw index e55acad915fb25420750e39587aa3fae11db123c..3d6b42c173382c08a142a6a72f6b873d9b52269a 100644 --- a/vignettes/dataRetrieval.Rnw +++ b/vignettes/dataRetrieval.Rnw @@ -228,7 +228,7 @@ In this section, five examples of Web retrievals document how to get raw data. T % %------------------------------------------------------------ The USGS organizes hydrologic data in a standard structure. Streamgages are located throughout the United States, and each streamgage has a unique ID. Often (but not always), these ID's are 8 digits. The first step to finding data is discovering this 8-digit ID. There are many ways to do this, one is the National Water Information System: Mapper \url{http://maps.waterdata.usgs.gov/mapper/index.html}. -Once the site-ID is known, the next required input for USGS data retrievals is the \enquote{parameter code}. This is a 5-digit code that specifies the measured parameter being requested. For example, parameter code 00631 represents \enquote{Nitrate plus nitrite, water, filtered, milligrams per liter as nitrogen}, with units of \enquote{mg/l as N}. A complete list of possible USGS parameter codes can be found at \url{http://nwis.waterdata.usgs.gov/usa/nwis/pmcodes?help}. +Once the site-ID (siteNumber) is known, the next required input for USGS data retrievals is the \enquote{parameter code}. This is a 5-digit code that specifies the measured parameter being requested. For example, parameter code 00631 represents \enquote{Nitrate plus nitrite, water, filtered, milligrams per liter as nitrogen}, with units of \enquote{mg/l as N}. A complete list of possible USGS parameter codes can be found at \url{http://nwis.waterdata.usgs.gov/usa/nwis/pmcodes?help}. Not every station will measure all parameters. A short list of commonly measured parameters is shown in Table \ref{tab:params}. @@ -526,12 +526,10 @@ There are additional water quality data sets available from the Water Quality Da <<label=getQWData, echo=TRUE>>= specificCond <- getWQPData('WIDNR_WQX-10032762', - 'Specific conductance','','') + 'Specific conductance','2011-05-01','2011-09-30') head(specificCond) @ -There are - \FloatBarrier %------------------------------------------------------------ \subsection{URL Construction} diff --git a/vignettes/dataRetrieval.lof b/vignettes/dataRetrieval.lof index 1d5933e2ec1907e8710ffb92fea21554da3c3123..8ac527e5dae3d03e3e021d3ca84816bae57aa58a 100644 --- a/vignettes/dataRetrieval.lof +++ b/vignettes/dataRetrieval.lof @@ -1,6 +1,7 @@ \select@language {american} \contentsline {figure}{\numberline {1}{\ignorespaces Temperature and discharge plot of Choptank River in 2012}}{11}{figure.caption.4} -\contentsline {figure}{\numberline {2}{\ignorespaces Default multiPlotDataOverview}}{25}{figure.caption.9} -\contentsline {figure}{\numberline {3}{\ignorespaces A simple R help file\relax }}{29}{figure.caption.13} -\contentsline {figure}{\numberline {4}{\ignorespaces A simple table produced in Microsoft\textregistered \ Excel. Additional formatting will be requried, for example converting u to $\mu $ \relax }}{32}{figure.caption.14} +\contentsline {figure}{\numberline {2}{\ignorespaces Nitrate plot of Choptank River}}{14}{figure.caption.5} +\contentsline {figure}{\numberline {3}{\ignorespaces Default multiPlotDataOverview}}{26}{figure.caption.10} +\contentsline {figure}{\numberline {4}{\ignorespaces A simple R help file\relax }}{30}{figure.caption.14} +\contentsline {figure}{\numberline {5}{\ignorespaces A simple table produced in Microsoft\textregistered \ Excel. Additional formatting will be requried, for example converting u to $\mu $ \relax }}{33}{figure.caption.15} \contentsfinish diff --git a/vignettes/dataRetrieval.log b/vignettes/dataRetrieval.log index 4e4456e65d3e76d510caa9b3cac562e21c35a0a6..815c8cec36ef1f415c819d72ed43b8bfebb6dbdb 100644 --- a/vignettes/dataRetrieval.log +++ b/vignettes/dataRetrieval.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2014.8.7) 9 SEP 2014 12:49 +This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2014.8.7) 11 SEP 2014 16:26 entering extended mode **dataRetrieval.tex (D:\LADData\RCode\dataRetrieval\vignettes\dataRetrieval.tex @@ -649,36 +649,36 @@ LaTeX Font Info: Font shape `TS1/phv/m/n' will be \tf@toc=\write4 (D:\LADData\RCode\dataRetrieval\vignettes\dataRetrieval.lof -LaTeX Font Info: Try loading font information for OT1+ztmcm on input line 5. +LaTeX Font Info: Try loading font information for OT1+ztmcm on input line 6. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\ot1ztmcm.fd" File: ot1ztmcm.fd 2000/01/03 Fontinst v1.801 font definitions for OT1/ztmcm. ) -LaTeX Font Info: Try loading font information for OML+ztmcm on input line 5. +LaTeX Font Info: Try loading font information for OML+ztmcm on input line 6. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\omlztmcm.fd" File: omlztmcm.fd 2000/01/03 Fontinst v1.801 font definitions for OML/ztmcm. ) -LaTeX Font Info: Try loading font information for OMS+ztmcm on input line 5. +LaTeX Font Info: Try loading font information for OMS+ztmcm on input line 6. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\omsztmcm.fd" File: omsztmcm.fd 2000/01/03 Fontinst v1.801 font definitions for OMS/ztmcm. ) -LaTeX Font Info: Try loading font information for OMX+ztmcm on input line 5. +LaTeX Font Info: Try loading font information for OMX+ztmcm on input line 6. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\omxztmcm.fd" File: omxztmcm.fd 2000/01/03 Fontinst v1.801 font definitions for OMX/ztmcm. ) LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <10.95> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 5. +(Font) Font shape `OT1/ptm/b/n' tried instead on input line 6. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <8> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 5. +(Font) Font shape `OT1/ptm/b/n' tried instead on input line 6. LaTeX Font Info: Font shape `OT1/ptm/bx/n' in size <6> not available -(Font) Font shape `OT1/ptm/b/n' tried instead on input line 5. +(Font) Font shape `OT1/ptm/b/n' tried instead on input line 6. ) \tf@lof=\write5 @@ -779,7 +779,7 @@ Package color Info: Redefining color shadecolor on input line 561. LaTeX Warning: No positions in optional float specifier. Default added (so using `tbp') on input line 580. -<figure/getNWIStemperaturePlot.pdf, id=268, 505.89pt x 505.89pt> +<figure/getNWIStemperaturePlot.pdf, id=270, 505.89pt x 505.89pt> File: figure/getNWIStemperaturePlot.pdf Graphic file (type pdf) <use figure/getNWIStemperaturePlot.pdf> @@ -804,21 +804,37 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [12] Package color Info: Redefining color shadecolor on input line 649. -Package color Info: Redefining color shadecolor on input line 674. +Package color Info: Redefining color shadecolor on input line 670. + + +LaTeX Warning: No positions in optional float specifier. + Default added (so using `tbp') on input line 679. + +<figure/getQWtemperaturePlot.pdf, id=291, 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 681 +. +(pdftex.def) Requested size: 448.07378pt x 448.07928pt. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [13] -Package color Info: Redefining color shadecolor on input line 702. -LaTeX Font Info: Try loading font information for TS1+pcr on input line 704. +Overfull \vbox (21.68121pt too high) has occurred while \output is active [] + + +[14 <D:/LADData/RCode/dataRetrieval/vignettes/figure/getQWtemperaturePlot.pdf>] +Package color Info: Redefining color shadecolor on input line 697. +LaTeX Font Info: Try loading font information for TS1+pcr on input line 699. - ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\ts1pcr.fd" +("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 731. +Package color Info: Redefining color shadecolor on input line 723. -Overfull \hbox (5.25568pt too wide) in paragraph at lines 740--740 +Overfull \hbox (5.25568pt too wide) in paragraph at lines 732--732 [][]\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 )[][ @@ -829,26 +845,22 @@ m/n/10.95 '\OT1/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 [] -[14] -Package color Info: Redefining color shadecolor on input line 762. - -Overfull \vbox (21.68121pt too high) has occurred while \output is active [] - - [15] -Package color Info: Redefining color shadecolor on input line 780. +Package color Info: Redefining color shadecolor on input line 754. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [16] -Package color Info: Redefining color shadecolor on input line 838. -Package color Info: Redefining color shadecolor on input line 850. +Package color Info: Redefining color shadecolor on input line 772. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [17] +Package color Info: Redefining color shadecolor on input line 830. +Package color Info: Redefining color shadecolor on input line 842. + Overfull \vbox (21.68121pt too high) has occurred while \output is active [] @@ -857,42 +869,46 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [19] -Package color Info: Redefining color shadecolor on input line 950. - Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [20] -Package color Info: Redefining color shadecolor on input line 1011. +Package color Info: Redefining color shadecolor on input line 942. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [21] -LaTeX Font Info: Try loading font information for OMS+pcr on input line 1016 +Package color Info: Redefining color shadecolor on input line 1003. + +Overfull \vbox (21.68121pt too high) has occurred while \output is active [] + + +[22] +LaTeX Font Info: Try loading font information for OMS+pcr on input line 1008 . ("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 1016. +(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 1008. -Package color Info: Redefining color shadecolor on input line 1047. +Package color Info: Redefining color shadecolor on input line 1039. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[22] -Package color Info: Redefining color shadecolor on input line 1072. -Package color Info: Redefining color shadecolor on input line 1092. +[23] +Package color Info: Redefining color shadecolor on input line 1064. +Package color Info: Redefining color shadecolor on input line 1084. -Overfull \hbox (44.67563pt too wide) in paragraph at lines 1117--1117 +Overfull \hbox (44.67563pt too wide) in paragraph at lines 1109--1109 [] \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 1117--1117 +Overfull \hbox (44.67563pt too wide) in paragraph at lines 1109--1109 [] \OT1/pcr/m/n/10.95 The first sample is from 2000-01-04 and the last sample i s from 2012-12-18[] [] @@ -901,73 +917,73 @@ s from 2012-12-18[] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[23] -Package color Info: Redefining color shadecolor on input line 1148. +[24] +Package color Info: Redefining color shadecolor on input line 1140. LaTeX Warning: No positions in optional float specifier. - Default added (so using `tbp') on input line 1154. + Default added (so using `tbp') on input line 1146. -<figure/egretEx.pdf, id=355, 505.89pt x 505.89pt> +<figure/egretEx.pdf, id=368, 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 1156. +Package pdftex.def Info: figure/egretEx.pdf used on input line 1148. (pdftex.def) Requested size: 448.07378pt x 448.07928pt. 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 <D:/LADData/RCode/dataRetrieval/vignettes/figure/egretEx.pdf>] +[26 <D:/LADData/RCode/dataRetrieval/vignettes/figure/egretEx.pdf>] 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] -Package color Info: Redefining color shadecolor on input line 1253. -Package color Info: Redefining color shadecolor on input line 1266. - <Rhelp.png, id=385, 433.62pt x 395.22656pt> +[28] +Package color Info: Redefining color shadecolor on input line 1245. +Package color Info: Redefining color shadecolor on input line 1258. + <Rhelp.png, id=398, 433.62pt x 395.22656pt> File: Rhelp.png Graphic file (type png) <use Rhelp.png> -Package pdftex.def Info: Rhelp.png used on input line 1285. +Package pdftex.def Info: Rhelp.png used on input line 1277. (pdftex.def) Requested size: 433.61894pt x 395.22559pt. -Package color Info: Redefining color shadecolor on input line 1292. +Package color Info: Redefining color shadecolor on input line 1284. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[28 +[29 ] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[29 <D:/LADData/RCode/dataRetrieval/vignettes/Rhelp.png>] -Package color Info: Redefining color shadecolor on input line 1307. -Package color Info: Redefining color shadecolor on input line 1319. +[30 <D:/LADData/RCode/dataRetrieval/vignettes/Rhelp.png>] +Package color Info: Redefining color shadecolor on input line 1299. +Package color Info: Redefining color shadecolor on input line 1311. LaTeX Font Info: Font shape `TS1/phv/bx/n' in size <17.28> not available -(Font) Font shape `TS1/phv/b/n' tried instead on input line 1328. +(Font) Font shape `TS1/phv/b/n' tried instead on input line 1320. LaTeX Font Info: Font shape `TS1/phv/b/n' will be -(Font) scaled to size 15.55188pt on input line 1328. -Package color Info: Redefining color shadecolor on input line 1334. +(Font) scaled to size 15.55188pt on input line 1320. +Package color Info: Redefining color shadecolor on input line 1326. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[30 +[31 ] -Package color Info: Redefining color shadecolor on input line 1371. +Package color Info: Redefining color shadecolor on input line 1363. -Overfull \hbox (11.82567pt too wide) in paragraph at lines 1388--1388 +Overfull \hbox (11.82567pt too wide) in paragraph at lines 1380--1380 []\OT1/pcr/m/n/10.95 Suspended sediment concentration (SSC) 1980-10-01 1991-09- 30 3651 mg/l[] [] @@ -976,32 +992,32 @@ Overfull \hbox (11.82567pt too wide) in paragraph at lines 1388--1388 Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[31] <table1.png, id=409, 554.07pt x 125.71968pt> +[32] <table1.png, id=422, 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 1407. +Package pdftex.def Info: table1.png used on input line 1399. (pdftex.def) Requested size: 554.06865pt x 125.71936pt. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[32 <D:/LADData/RCode/dataRetrieval/vignettes/table1.png>] -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1432. -Package atveryend Info: Empty hook `AfterLastShipout' on input line 1432. +[33 <D:/LADData/RCode/dataRetrieval/vignettes/table1.png>] +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1424. +Package atveryend Info: Empty hook `AfterLastShipout' on input line 1424. (D:\LADData\RCode\dataRetrieval\vignettes\dataRetrieval.aux) -Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1432. -Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1432. +Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1424. +Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1424. Package rerunfilecheck Info: File `dataRetrieval.out' has not changed. (rerunfilecheck) Checksum: 09D57CF47C75A1B38FC38F889C2C3F6D;1818. -Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1432. +Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1424. ) Here is how much of TeX's memory you used: - 9959 strings out of 493921 - 148884 string characters out of 3144868 - 249540 words of memory out of 3000000 - 12958 multiletter control sequences out of 15000+200000 + 9967 strings out of 493921 + 149101 string characters out of 3144868 + 249602 words of memory out of 3000000 + 12963 multiletter control sequences out of 15000+200000 47347 words of font info for 96 fonts, out of 3000000 for 9000 841 hyphenation exceptions out of 8191 44i,15n,42p,957b,506s stack positions out of 5000i,500n,10000p,200000b,50000s @@ -1016,9 +1032,9 @@ rw/helvetic/uhvr8a.pfb><C:/Users/ldecicco/AppData/Roaming/MiKTeX/2.9/fonts/type 1/urw/symbol/usyr.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/urw/times/ utmr8a.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/urw/times/utmri8a.pfb > -Output written on dataRetrieval.pdf (32 pages, 302823 bytes). +Output written on dataRetrieval.pdf (33 pages, 339117 bytes). PDF statistics: - 473 PDF objects out of 1000 (max. 8388607) - 82 named destinations out of 1000 (max. 500000) - 229 words of extra memory for PDF output out of 10000 (max. 10000000) + 486 PDF objects out of 1000 (max. 8388607) + 84 named destinations out of 1000 (max. 500000) + 234 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/vignettes/dataRetrieval.lot b/vignettes/dataRetrieval.lot index 491563a0adeb2de6a68217e80188dcfd22454364..d77d60e5b3acbacf827bf913c5de4f2eaba7ef2a 100644 --- a/vignettes/dataRetrieval.lot +++ b/vignettes/dataRetrieval.lot @@ -2,9 +2,9 @@ \contentsline {table}{\numberline {1}{\ignorespaces Common USGS Parameter Codes\relax }}{5}{table.caption.1} \contentsline {table}{\numberline {2}{\ignorespaces Commonly used USGS Stat Codes\relax }}{6}{table.caption.2} \contentsline {table}{\numberline {3}{\ignorespaces Daily mean data availabile at the Choptank River near Greensboro, MD. [Some columns deleted for space considerations]\relax }}{7}{table.caption.3} -\contentsline {table}{\numberline {4}{\ignorespaces Daily dataframe\relax }}{16}{table.caption.5} -\contentsline {table}{\numberline {5}{\ignorespaces Sample dataframe\relax }}{18}{table.caption.7} -\contentsline {table}{\numberline {6}{\ignorespaces Example data\relax }}{19}{table.caption.8} -\contentsline {table}{\numberline {7}{\ignorespaces dataRetrieval functions\relax }}{27}{table.caption.11} -\contentsline {table}{\numberline {8}{\ignorespaces dataRetrieval miscellaneous functions\relax }}{27}{table.caption.12} +\contentsline {table}{\numberline {4}{\ignorespaces Daily dataframe\relax }}{17}{table.caption.6} +\contentsline {table}{\numberline {5}{\ignorespaces Sample dataframe\relax }}{19}{table.caption.8} +\contentsline {table}{\numberline {6}{\ignorespaces Example data\relax }}{20}{table.caption.9} +\contentsline {table}{\numberline {7}{\ignorespaces dataRetrieval functions\relax }}{28}{table.caption.12} +\contentsline {table}{\numberline {8}{\ignorespaces dataRetrieval miscellaneous functions\relax }}{28}{table.caption.13} \contentsfinish diff --git a/vignettes/dataRetrieval.pdf b/vignettes/dataRetrieval.pdf index cd1118d0a36edfe818ed08d7f3eb97b4942f8a3e..224629c85bd99569fe02ed9e0368084695e25e2e 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 5954facaaeb66dd69dcaccae9275f762775f2b49..31fdac390ca8e5e489ec463ee55b7e3470b27078 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 fc9a852b6e1bf6e029db44278463e04e66199104..4f84b9b192baed5048709f1d44f11d62c8223d8b 100644 --- a/vignettes/dataRetrieval.tex +++ b/vignettes/dataRetrieval.tex @@ -261,13 +261,13 @@ In this section, five examples of Web retrievals document how to get raw data. T % %------------------------------------------------------------ The USGS organizes hydrologic data in a standard structure. Streamgages are located throughout the United States, and each streamgage has a unique ID. Often (but not always), these ID's are 8 digits. The first step to finding data is discovering this 8-digit ID. There are many ways to do this, one is the National Water Information System: Mapper \url{http://maps.waterdata.usgs.gov/mapper/index.html}. -Once the site-ID is known, the next required input for USGS data retrievals is the \enquote{parameter code}. This is a 5-digit code that specifies the measured parameter being requested. For example, parameter code 00631 represents \enquote{Nitrate plus nitrite, water, filtered, milligrams per liter as nitrogen}, with units of \enquote{mg/l as N}. A complete list of possible USGS parameter codes can be found at \url{http://nwis.waterdata.usgs.gov/usa/nwis/pmcodes?help}. +Once the site-ID (siteNumber) is known, the next required input for USGS data retrievals is the \enquote{parameter code}. This is a 5-digit code that specifies the measured parameter being requested. For example, parameter code 00631 represents \enquote{Nitrate plus nitrite, water, filtered, milligrams per liter as nitrogen}, with units of \enquote{mg/l as N}. A complete list of possible USGS parameter codes can be found at \url{http://nwis.waterdata.usgs.gov/usa/nwis/pmcodes?help}. Not every station will measure all parameters. A short list of commonly measured parameters is shown in Table \ref{tab:params}. % latex table generated in R 3.1.1 by xtable 1.7-3 package -% Tue Sep 09 12:48:00 2014 +% Thu Sep 11 16:26:30 2014 \begin{table}[ht] \caption{Common USGS Parameter Codes} \label{tab:params} @@ -330,7 +330,7 @@ For unit values data (sensor data measured at regular time intervals such as 15 Some common codes are shown in Table \ref{tab:stat}. % latex table generated in R 3.1.1 by xtable 1.7-3 package -% Tue Sep 09 12:48:01 2014 +% Thu Sep 11 16:26:31 2014 \begin{table}[ht] \caption{Commonly used USGS Stat Codes} \label{tab:stat} @@ -411,7 +411,7 @@ To discover what data is available for a particular USGS site, including measure % latex table generated in R 3.1.1 by xtable 1.7-3 package -% Tue Sep 09 12:48:02 2014 +% Thu Sep 11 16:26:32 2014 \begin{table}[ht] \caption{Daily mean data availabile at the Choptank River near Greensboro, MD. [Some columns deleted for space considerations]} \label{tab:gda} @@ -423,7 +423,7 @@ To discover what data is available for a particular USGS site, including measure & Temperature, water & 1988-10-01 & 2012-05-09 & 894 & deg C \\ [5pt] & Temperature, water & 2010-10-01 & 2012-05-09 & 529 & deg C \\ [5pt] & Temperature, water & 2010-10-01 & 2012-05-09 & 529 & deg C \\ - [5pt] & Stream flow, mean. daily & 1948-01-01 & 2014-09-08 & 24358 & ft$^3$/s \\ + [5pt] & Stream flow, mean. daily & 1948-01-01 & 2014-09-10 & 24360 & ft$^3$/s \\ [5pt] & Specific conductance & 2010-10-01 & 2012-05-09 & 527 & uS/cm @25C \\ [5pt] & Specific conductance & 2010-10-01 & 2012-05-09 & 527 & uS/cm @25C \\ [5pt] & Specific conductance & 2010-10-01 & 2012-05-09 & 527 & uS/cm @25C \\ @@ -613,20 +613,20 @@ The retrieval produces the following dataframe: \begin{knitrout} \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe} \begin{verbatim} - agency site dateTime tz_cd X02_00060_00011 -1 USGS 01491000 2012-05-12 00:00:00 EST 83 -2 USGS 01491000 2012-05-12 00:15:00 EST 83 -3 USGS 01491000 2012-05-12 00:30:00 EST 83 -4 USGS 01491000 2012-05-12 00:45:00 EST 83 -5 USGS 01491000 2012-05-12 01:00:00 EST 85 -6 USGS 01491000 2012-05-12 01:15:00 EST 83 - X02_00060_00011_cd -1 A -2 A -3 A -4 A -5 A -6 A + agency_cd site_no datetime tz_cd +1 USGS 01491000 2012-05-12 00:00:00 EST +2 USGS 01491000 2012-05-12 00:15:00 EST +3 USGS 01491000 2012-05-12 00:30:00 EST +4 USGS 01491000 2012-05-12 00:45:00 EST +5 USGS 01491000 2012-05-12 01:00:00 EST +6 USGS 01491000 2012-05-12 01:15:00 EST + X02_00060_00011 X02_00060_00011_cd +1 83 A +2 83 A +3 83 A +4 83 A +5 85 A +6 83 A \end{verbatim} \end{kframe} \end{knitrout} @@ -655,17 +655,13 @@ To get USGS water quality data from water samples collected at the streamgage or \hlstd{dissolvedNitrate} \hlkwb{<-} \hlkwd{retrieveNWISqwData}\hlstd{(siteNumber, parameterCd,} \hlstd{startDate, endDate)} -\end{alltt} - - -{\ttfamily\noindent\color{warningcolor}{Warning: cannot open: HTTP status was '0 (nil)'}} - -{\ttfamily\noindent\bfseries\color{errorcolor}{Error: cannot open the connection}}\begin{alltt} \hlkwd{names}\hlstd{(dissolvedNitrate)} \end{alltt} - - -{\ttfamily\noindent\bfseries\color{errorcolor}{Error: object 'dissolvedNitrate' not found}}\end{kframe} +\begin{verbatim} +[1] "dateTime" "site" "qualifier_00618" +[4] "value_00618" "qualifier_71851" "value_71851" +\end{verbatim} +\end{kframe} \end{knitrout} % Note that in this \enquote{simple} dataframe, datetime is imported as Dates (no times are included), and the qualifier is either blank or \verb@"<"@ signifying a censored value. A plotting example is shown in Figure \ref{fig:getQWtemperaturePlot}. @@ -678,15 +674,14 @@ To get USGS water quality data from water samples collected at the streamgage or \hlkwc{xlab}\hlstd{=}\hlstr{"Date"}\hlstd{,}\hlkwc{ylab} \hlstd{=} \hlkwd{paste}\hlstd{(parameterINFO}\hlopt{$}\hlstd{srsname,} \hlstr{"["}\hlstd{,parameterINFO}\hlopt{$}\hlstd{parameter_units,}\hlstr{"]"}\hlstd{)} \hlstd{))} -\end{alltt} - - -{\ttfamily\noindent\bfseries\color{errorcolor}{Error: object 'dissolvedNitrate' not found}}\begin{alltt} \hlkwd{title}\hlstd{(ChoptankInfo}\hlopt{$}\hlstd{station.nm)} \end{alltt} +\end{kframe}\begin{figure}[] + +\includegraphics[width=\maxwidth]{figure/getQWtemperaturePlot} \caption[Nitrate plot of Choptank River]{Nitrate plot of Choptank River.\label{fig:getQWtemperaturePlot}} +\end{figure} -{\ttfamily\noindent\bfseries\color{errorcolor}{Error: plot.new has not been called yet}}\end{kframe} \end{knitrout} \FloatBarrier @@ -702,23 +697,20 @@ There are additional water quality data sets available from the Water Quality Da \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe} \begin{alltt} \hlstd{specificCond} \hlkwb{<-} \hlkwd{getWQPData}\hlstd{(}\hlstr{'WIDNR_WQX-10032762'}\hlstd{,} - \hlstr{'Specific conductance'}\hlstd{,}\hlstr{''}\hlstd{,}\hlstr{''}\hlstd{)} + \hlstr{'Specific conductance'}\hlstd{,}\hlstr{'2011-05-01'}\hlstd{,}\hlstr{'2011-09-30'}\hlstd{)} \hlkwd{head}\hlstd{(specificCond)} \end{alltt} \begin{verbatim} dateTime qualifier. value. -1 2011-02-14 1360 -2 2011-02-17 1930 -3 2011-03-03 1240 -4 2011-03-10 1480 -5 2011-03-29 1130 -6 2011-04-07 1200 +1 2011-05-09 1000 +2 2011-06-05 800 +3 2011-07-06 860 +4 2011-08-08 471 +5 2011-09-11 750 \end{verbatim} \end{kframe} \end{knitrout} -There are - \FloatBarrier %------------------------------------------------------------ \subsection{URL Construction} @@ -794,7 +786,7 @@ There are 4750 data points, and 4750 days. % latex table generated in R 3.1.1 by xtable 1.7-3 package -% Tue Sep 09 12:49:17 2014 +% Thu Sep 11 16:26:44 2014 \begin{table}[ht] \caption{Daily dataframe} \label{tab:DailyDF1} @@ -915,7 +907,7 @@ To illustrate how the dataRetrieval package handles a more complex censoring pro % latex table generated in R 3.1.1 by xtable 1.7-3 package -% Tue Sep 09 12:49:44 2014 +% Thu Sep 11 16:26:45 2014 \begin{table}[ht] \caption{Example data} \label{tab:exampleComplexQW} @@ -1356,7 +1348,7 @@ There are a few steps that are required in order to create a table in Microsoft\ 5 Suspended sediment discharge 1980-10-01 End Count Units 1 2012-05-09 529 deg C -2 2014-09-08 24358 ft3/s +2 2014-09-10 24360 ft3/s 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 92d62142883ddf708dd4e64ac133b8529dc9e89c..da70f97eb48c23c9ad26c21a0136d5440889e0e0 100644 --- a/vignettes/dataRetrieval.toc +++ b/vignettes/dataRetrieval.toc @@ -8,21 +8,21 @@ \contentsline {subsection}{\numberline {2.3}Daily Values}{8}{subsection.2.3} \contentsline {subsection}{\numberline {2.4}Unit Values}{12}{subsection.2.4} \contentsline {subsection}{\numberline {2.5}Water Quality Values}{13}{subsection.2.5} -\contentsline {subsection}{\numberline {2.6}STORET Water Quality Retrievals}{13}{subsection.2.6} -\contentsline {subsection}{\numberline {2.7}URL Construction}{14}{subsection.2.7} -\contentsline {section}{\numberline {3}Data Retrievals Structured For Use In The EGRET Package}{15}{section.3} -\contentsline {subsection}{\numberline {3.1}INFO Data}{15}{subsection.3.1} -\contentsline {subsection}{\numberline {3.2}Daily Data}{15}{subsection.3.2} -\contentsline {subsection}{\numberline {3.3}Sample Data}{17}{subsection.3.3} -\contentsline {subsection}{\numberline {3.4}Censored Values: Summation Explanation}{18}{subsection.3.4} -\contentsline {subsection}{\numberline {3.5}User-Generated Data Files}{20}{subsection.3.5} -\contentsline {subsubsection}{\numberline {3.5.1}getDailyDataFromFile}{20}{subsubsection.3.5.1} -\contentsline {subsubsection}{\numberline {3.5.2}getSampleDataFromFile}{22}{subsubsection.3.5.2} -\contentsline {subsection}{\numberline {3.6}Merge Report}{23}{subsection.3.6} -\contentsline {subsection}{\numberline {3.7}EGRET Plots}{24}{subsection.3.7} -\contentsline {section}{\numberline {4}Summary}{26}{section.4} -\contentsline {section}{\numberline {5}Getting Started in R}{28}{section.5} -\contentsline {subsection}{\numberline {5.1}New to R?}{28}{subsection.5.1} -\contentsline {subsection}{\numberline {5.2}R User: Installing dataRetrieval}{30}{subsection.5.2} -\contentsline {section}{\numberline {6}Creating tables in Microsoft\textregistered \ software from R}{30}{section.6} +\contentsline {subsection}{\numberline {2.6}STORET Water Quality Retrievals}{15}{subsection.2.6} +\contentsline {subsection}{\numberline {2.7}URL Construction}{15}{subsection.2.7} +\contentsline {section}{\numberline {3}Data Retrievals Structured For Use In The EGRET Package}{16}{section.3} +\contentsline {subsection}{\numberline {3.1}INFO Data}{16}{subsection.3.1} +\contentsline {subsection}{\numberline {3.2}Daily Data}{17}{subsection.3.2} +\contentsline {subsection}{\numberline {3.3}Sample Data}{18}{subsection.3.3} +\contentsline {subsection}{\numberline {3.4}Censored Values: Summation Explanation}{19}{subsection.3.4} +\contentsline {subsection}{\numberline {3.5}User-Generated Data Files}{21}{subsection.3.5} +\contentsline {subsubsection}{\numberline {3.5.1}getDailyDataFromFile}{21}{subsubsection.3.5.1} +\contentsline {subsubsection}{\numberline {3.5.2}getSampleDataFromFile}{23}{subsubsection.3.5.2} +\contentsline {subsection}{\numberline {3.6}Merge Report}{24}{subsection.3.6} +\contentsline {subsection}{\numberline {3.7}EGRET Plots}{25}{subsection.3.7} +\contentsline {section}{\numberline {4}Summary}{27}{section.4} +\contentsline {section}{\numberline {5}Getting Started in R}{29}{section.5} +\contentsline {subsection}{\numberline {5.1}New to R?}{29}{subsection.5.1} +\contentsline {subsection}{\numberline {5.2}R User: Installing dataRetrieval}{31}{subsection.5.2} +\contentsline {section}{\numberline {6}Creating tables in Microsoft\textregistered \ software from R}{31}{section.6} \contentsfinish diff --git a/vignettes/figure/egretEx.pdf b/vignettes/figure/egretEx.pdf index a06015d8e264ca3b58306f198bf8778e98cd0ddd..5e59040b2d1c145403793b103e16359c0676f2e7 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 543a6678089fd3eb304d3c9307cdffe40fc35d30..c1565924c0db4faaf6152dac05de61a2982fcf54 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 c58903c939ff755fb487efaa3c393dd21230220d..0e723813845d5095beed2e7471c2975e3f631ec4 100644 Binary files a/vignettes/figure/getQWtemperaturePlot.pdf and b/vignettes/figure/getQWtemperaturePlot.pdf differ