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

Latest build.

parent c73d84de
No related branches found
No related tags found
1 merge request!39Overhaul of function names. Move some functionality to EGRET.
......@@ -155,7 +155,7 @@ temperatureAndFlow <- readNWISdv(siteNumber, parameterCd,
## ----label=renameColumns, echo=TRUE-----------------------
names(temperatureAndFlow)
temperatureAndFlow <- renameColumns(temperatureAndFlow)
temperatureAndFlow <- renameNWISColumns(temperatureAndFlow)
names(temperatureAndFlow)
## ----getNWIStemperaturePlot, echo=TRUE, fig.cap="Temperature and discharge plot of Choptank River in 2012.",out.width='1\\linewidth',out.height='1\\linewidth',fig.show='hold'----
......
......@@ -472,12 +472,12 @@ temperatureAndFlow <- readNWISdv(siteNumber, parameterCd,
Daily data is pulled from \url{http://waterservices.usgs.gov/rest/DV-Test-Tool.html}.
The column names can be automatically adjusted based on the parameter and statistic codes using the \texttt{renameColumns} function. This is not necessary, but may be useful when analyzing the data.
The column names can be automatically adjusted based on the parameter and statistic codes using the \texttt{renameNWISColumns} function. This is not necessary, but may be useful when analyzing the data.
<<label=renameColumns, echo=TRUE>>=
names(temperatureAndFlow)
temperatureAndFlow <- renameColumns(temperatureAndFlow)
temperatureAndFlow <- renameNWISColumns(temperatureAndFlow)
names(temperatureAndFlow)
@
......
No preview for this file type
......@@ -3,10 +3,10 @@
\alias{readNWISgwl}
\title{Reads groundwater level measurements from NWISweb.}
\usage{
readNWISgwl(siteNumber, startDate = "", endDate = "")
readNWISgwl(siteNumbers, startDate = "", endDate = "")
}
\arguments{
\item{siteNumber}{string USGS site number. This is usually an 8 digit number}
\item{siteNumbers}{string USGS site number (or multiple sites). This is usually an 8 digit number}
\item{startDate}{string starting date for data retrieval in the form YYYY-MM-DD.}
......@@ -19,5 +19,7 @@ depending on the year that the data was collected.
\examples{
siteNumber <- "434400121275801"
data <- readNWISgwl(siteNumber, '','')
sites <- c("434400121275801", "375907091432201")
data2 <- readNWISgwl(sites, '','')
}
......@@ -3,10 +3,11 @@
\alias{readNWISuv}
\title{Raw Data Import for Instantaneous USGS NWIS Data}
\usage{
readNWISuv(siteNumber, parameterCd, startDate = "", endDate = "", tz = "")
readNWISuv(siteNumbers, parameterCd, startDate = "", endDate = "",
tz = "")
}
\arguments{
\item{siteNumber}{string USGS site number. This is usually an 8 digit number}
\item{siteNumbers}{string USGS site number (or multiple sites). This is usually an 8 digit number}
\item{parameterCd}{string USGS parameter code. This is usually an 5 digit number.}
......
% Generated by roxygen2 (4.0.2): do not edit by hand
\name{renameColumns}
\alias{renameColumns}
\title{renameColumns}
\usage{
renameColumns(rawData, p00010 = "Wtemp", p00045 = "Precip",
p00060 = "Flow", p00065 = "GH", p00095 = "SpecCond", p00300 = "DO",
p00400 = "pH", p62611 = "GWL", p63680 = "Turb", p72019 = "WLBLS", ...)
}
\arguments{
\item{rawData}{dataframe returned from retrieval functions}
}
\value{
rawData dataframe with improved column names
}
\description{
Rename columns coming back from NWIS data retrievals
}
\examples{
siteWithTwo <- '01480015'
startDate <- "2012-09-01"
endDate <- "2012-10-01"
url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv')
twoResults <- importWaterML1(url2,TRUE)
twoResults <- renameColumns(twoResults)
}
\keyword{USGS}
\keyword{data}
\keyword{import}
\keyword{service}
\keyword{web}
% Generated by roxygen2 (4.0.2): do not edit by hand
\name{renameNWISColumns}
\alias{renameNWISColumns}
\title{renameColumns}
\usage{
renameNWISColumns(rawData, p00010 = "Wtemp", p00045 = "Precip",
p00060 = "Flow", p00065 = "GH", p00095 = "SpecCond", p00300 = "DO",
p00400 = "pH", p62611 = "GWL", p63680 = "Turb", p72019 = "WLBLS", ...)
}
\arguments{
\item{rawData}{the daily- or unit-values datset retrieved from NWISweb.}
\item{p00010}{the base name for parameter code 00010.}
\item{p00045}{the base name for parameter code 00045.}
\item{p00060}{the base name for parameter code 00060.}
\item{p00065}{the base name for parameter code 00065.}
\item{p00095}{the base name for parameter code 00095.}
\item{p00300}{the base name for parameter code 00300.}
\item{p00400}{the base name for parameter code 00400.}
\item{p62611}{the base name for parameter code 62611.}
\item{p63680}{the base name for parameter code 63680.}
\item{p72019}{the base name for parameter code 72019.}
\item{\dots}{named arguments for the base name for any other parameter code. The
form of the name must be like pXXXXX, where XXXXX is the parameter code.}
}
\value{
A dataset like \code{data} with selected columns renamed.
}
\description{
Rename columns coming back from NWIS data retrievals. Daily and unit value columns
have names derived from their data descriptor, parameter, and statistic codes. This
function reads information from the header and the arguments in the call to
to rename those columns.
}
\note{
The following statistics codes are converted by \code{renameNWISColumns}. See
\url{http://help.waterdata.usgs.gov/stat_cd_nm} for information about USGS statistics codes.
\describe{
\item{00001}{Maximum value, suffix: Max}
\item{00002}{Minimum value, suffix: Min}
\item{00003}{Mean value, no suffix}
\item{00006}{Sum of values, suffix: Sum}
\item{00007}{Modal value, suffix: Mode}
\item{00008}{Median value, suffix: Median}
\item{00011}{Instantaneous Value, suffix: Inst}
\item{00012}{Equivalent mean value, suffix: EqMean}
\item{00021}{Tidal high-high value, suffix: HiHiTide}
\item{00022}{Tidal low-high value, suffix: LoHiTide}
\item{00023}{Tidal high-low value, suffix: HiLoTide}
\item{00024}{Tidal low-low value, suffix: LoLoTide}
}
}
\examples{
siteWithTwo <- '01480015'
startDate <- "2012-09-01"
endDate <- "2012-10-01"
url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv')
twoResults <- importWaterML1(url2,TRUE)
twoResults <- renameNWISColumns(twoResults)
}
\seealso{
\code{\link{readNWISdv}}, \code{\link{readNWISuv}}
}
\keyword{IO}
\keyword{manip}
\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 %
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}
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