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

Latest vignette build.

parent ee58b8d9
No related branches found
No related tags found
1 merge request!39Overhaul of function names. Move some functionality to EGRET.
......@@ -195,19 +195,47 @@ parameterCd <- c("00618","71851")
startDate <- "1985-10-01"
endDate <- "2012-09-30"
dissolvedNitrate <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE)
names(dissolvedNitrate)
dissolvedNitrateLong <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE,reshape=FALSE)
names(dissolvedNitrateLong)
## ----getQWtemperaturePlot, echo=TRUE, fig.cap=paste(parameterINFO$parameter_nm, "at", siteINFO$station.nm[1])----
with(dissolvedNitrate, plot(
startDateTime, result_va_00618,
xlab="Date",ylab = paste(parameterINFO$srsname,
"[",parameterINFO$parameter_units,"]")
))
title(siteINFO$station.nm[1])
## ----label=getQWwide, echo=TRUE---------------------------
dissolvedNitrateWide <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE, reshape=TRUE)
names(dissolvedNitrateWide)
## ----gwlexample, echo=TRUE, eval=TRUE---------------------
siteNumber <- "434400121275801"
groundWater <- readNWISgwl(siteNumber, '','')
groundWater <- renameNWISColumns(groundWater)
names(groundWater)
## ----peakexample, echo=TRUE, eval=TRUE--------------------
siteNumber <- '01594440'
peakData <- readNWISpeak(siteNumber)
names(peakData)
## ----ratingexample, echo=TRUE, eval=TRUE------------------
ratingData <- readNWISrating(siteNumber, "base")
attr(ratingData, "RATING")
names(ratingData)
## ----surfexample, echo=TRUE, eval=TRUE--------------------
surfaceData <- readNWISmeas(siteNumber)
names(surfaceData)
## ----label=geturl, echo=TRUE, eval=FALSE------------------
# # Dissolved Nitrate parameter codes:
......
......@@ -345,7 +345,7 @@ Examples for using these siteNumber's, parameter codes, and stat codes will be p
\subsubsection{readNWISsite}
\label{sec:usgsSiteFileData}
%------------------------------------------------------------
Use the \texttt{readNWISsite} function to obtain all of the information available for a particular USGS site such as full station name, drainage area, latitude, and longitude. \texttt{readNWISsite} can also access information about multiple sites with a vector input.
Use the \texttt{readNWISsite} function to obtain all of the information available for a particular USGS site (or sites) such as full station name, drainage area, latitude, and longitude. \texttt{readNWISsite} can also access information about multiple sites with a vector input.
<<getSite, echo=TRUE>>=
......@@ -542,9 +542,11 @@ Data are retrieved from \url{http://waterservices.usgs.gov/rest/IV-Test-Tool.htm
\subsection{Water Quality Values}
\label{sec:usgsWQP}
%------------------------------------------------------------
To get USGS water quality data from water samples collected at the streamgage or other monitoring site (as distinct from unit values collected through some type of automatic monitor) we can use the function \texttt{readNWISqw}, with the input arguments: siteNumber, parameterCd, startDate, and endDate and \texttt{readNWISdv}). Additionally, the argument \texttt{"}expanded\texttt{"} is a logical input that allows the user to choose between a simple return of datetimes/qualifier/values (expanded=FALSE), or a more complete and verbose output (expanded=TRUE). Expanded = TRUE includes such columns as remark codes, value qualifying text, and detection level.
To get USGS water quality data from water samples collected at the streamgage or other monitoring site (as distinct from unit values collected through some type of automatic monitor) we can use the function \texttt{readNWISqw}, with the input arguments: siteNumber, parameterCd, startDate, and endDate and \texttt{readNWISdv}). Additionally, the argument \texttt{"}expanded\texttt{"} is a logical input that allows the user to choose between a simple return of datetimes/qualifier/values (expanded=FALSE), or a more complete and verbose output (expanded=TRUE). Expanded = TRUE includes such columns as remark codes, value qualifying text, and detection level for each parameter code.
There also includes an argument \texttt{"}reshape\texttt{"}, that converts the expanded dataset to a \texttt{"}wide\texttt{"} format.
<<label=getQW, echo=TRUE>>=
# Dissolved Nitrate parameter codes:
......@@ -552,44 +554,95 @@ parameterCd <- c("00618","71851")
startDate <- "1985-10-01"
endDate <- "2012-09-30"
dissolvedNitrate <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE)
names(dissolvedNitrate)
dissolvedNitrateLong <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE,reshape=FALSE)
names(dissolvedNitrateLong)
@
<<getQWtemperaturePlot, echo=TRUE, fig.cap=paste(parameterINFO$parameter_nm, "at", siteINFO$station.nm[1])>>=
with(dissolvedNitrate, plot(
startDateTime, result_va_00618,
xlab="Date",ylab = paste(parameterINFO$srsname,
"[",parameterINFO$parameter_units,"]")
))
title(siteINFO$station.nm[1])
<<label=getQWwide, echo=TRUE>>=
dissolvedNitrateWide <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE, reshape=TRUE)
names(dissolvedNitrateWide)
@
% <<getQWtemperaturePlot, echo=TRUE, fig.cap=paste(parameterINFO$parameter_nm, "at", siteINFO$station.nm[1])>>=
% with(dissolvedNitrate, plot(
% startDateTime, result_va_00618,
% xlab="Date",ylab = paste(parameterINFO$srsname,
% "[",parameterINFO$parameter_units,"]")
% ))
% title(siteINFO$station.nm[1])
% @
\FloatBarrier
%------------------------------------------------------------
\subsection{Ground water level data}
\subsection{Groundwater level data}
\label{sec:gwl}
%------------------------------------------------------------
Groundwater level measurements can be obtained with the \texttt{readNWISgwl} function.
<<gwlexample, echo=TRUE, eval=TRUE>>=
siteNumber <- "434400121275801"
groundWater <- readNWISgwl(siteNumber, '','')
groundWater <- renameNWISColumns(groundWater)
names(groundWater)
@
%------------------------------------------------------------
\subsection{Peak flow data}
\label{sec:peak}
%------------------------------------------------------------
Peak discharge measurements can be obtained with the \texttt{readNWISpeak} function.
<<peakexample, echo=TRUE, eval=TRUE>>=
siteNumber <- '01594440'
peakData <- readNWISpeak(siteNumber)
names(peakData)
@
%------------------------------------------------------------
\subsection{Rating curve data}
\label{sec:rating}
%------------------------------------------------------------
Rating curves can be obtained with the \texttt{readNWISrating} function.
<<ratingexample, echo=TRUE, eval=TRUE>>=
ratingData <- readNWISrating(siteNumber, "base")
attr(ratingData, "RATING")
names(ratingData)
@
%------------------------------------------------------------
\subsection{Surface-water measurement data}
\label{sec:meas}
%------------------------------------------------------------
Surface-water measurement data can be obtained with the \texttt{readNWISmeas} function.
<<surfexample, echo=TRUE, eval=TRUE>>=
surfaceData <- readNWISmeas(siteNumber)
names(surfaceData)
@
%------------------------------------------------------------
\subsection{URL Construction}
......
No preview for this file type
\Sconcordance{concordance:dataRetrieval.tex:dataRetrieval.Rnw:%
1 127 1 49 0 1 7 15 1 1 14 45 1 3 0 93 1 2 0 8 1 9 0 %
24 1 3 0 21 1 4 0 6 1 8 0 18 1 3 0 25 1 1 4 19 1 9 0 %
24 1 3 0 21 1 4 0 6 1 7 0 18 1 3 0 25 1 1 4 19 1 9 0 %
6 1 7 0 23 1 7 0 16 1 2 0 11 1 15 0 22 1 9 0 20 1 3 0 %
6 1 20 0 30 1 38 0 10 1 9 0 40 1 4 0 14 1 4 0 33 1 13 %
0 39 1 14 0 18 1 2 0 14 1 2 0 24 1 4 0 9 1 14 0 13 1 %
4 0 14 1 4 0 5 1 4 0 22 1 18 0 8 1 4 0 43 1}
6 1 20 0 32 1 26 0 8 1 40 0 27 1 9 0 16 1 10 0 15 1 %
13 0 15 1 14 0 20 1 4 0 14 1 4 0 33 1 13 0 39 1 14 0 %
18 1 2 0 14 1 2 0 24 1 4 0 9 1 23 0 13 1 4 0 14 1 4 0 %
5 1 4 0 22 1 14 0 8 1 4 0 43 1}
......@@ -545,6 +545,8 @@ Data are retrieved from \url{http://waterservices.usgs.gov/rest/IV-Test-Tool.htm
To get USGS water quality data from water samples collected at the streamgage or other monitoring site (as distinct from unit values collected through some type of automatic monitor) we can use the function \texttt{readNWISqw}, with the input arguments: siteNumber, parameterCd, startDate, and endDate and \texttt{readNWISdv}). Additionally, the argument \texttt{"}expanded\texttt{"} is a logical input that allows the user to choose between a simple return of datetimes/qualifier/values (expanded=FALSE), or a more complete and verbose output (expanded=TRUE). Expanded = TRUE includes such columns as remark codes, value qualifying text, and detection level for each parameter code.
There also includes an argument \texttt{"}reshape\texttt{"}, that converts the expanded dataset to a \texttt{"}wide\texttt{"} format.
<<label=getQW, echo=TRUE>>=
# Dissolved Nitrate parameter codes:
......@@ -552,14 +554,21 @@ parameterCd <- c("00618","71851")
startDate <- "1985-10-01"
endDate <- "2012-09-30"
dissolvedNitrate <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE)
names(dissolvedNitrate)
dissolvedNitrateLong <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE,reshape=FALSE)
names(dissolvedNitrateLong)
@
<<label=getQWwide, echo=TRUE>>=
dissolvedNitrateWide <- readNWISqw(siteNumber, parameterCd,
startDate, endDate, expanded=TRUE, reshape=TRUE)
names(dissolvedNitrateWide)
@
% <<getQWtemperaturePlot, echo=TRUE, fig.cap=paste(parameterINFO$parameter_nm, "at", siteINFO$station.nm[1])>>=
% with(dissolvedNitrate, plot(
% startDateTime, result_va_00618,
......
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment