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

Remove links to help pages.

parent 80f83476
No related branches found
No related tags found
1 merge request!135Minimize examples to web services
#' Daily Value USGS NWIS Data Retrieval #' Daily Value USGS NWIS Data Retrieval
#' #'
#' Imports data from NWIS web service. This function gets the data from here: \url{http://waterservices.usgs.gov/} #' Imports data from NWIS web service. This function gets the data from here: \url{http://waterservices.usgs.gov/}
#' Information on parameter and statistics codes can be found here: \url{http://help.waterdata.usgs.gov}
#' #'
#' @param siteNumber character USGS site number. This is usually an 8 digit number. Multiple sites can be requested with a character vector. #' @param siteNumber character USGS site number. This is usually an 8 digit number. Multiple sites can be requested with a character vector.
#' @param parameterCd character of USGS parameter code(s). This is usually an 5 digit number. #' @param parameterCd character of USGS parameter code(s). This is usually an 5 digit number.
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
#' @param \dots named arguments for the base name for any other parameter code. The #' @param \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. #'form of the name must be like pXXXXX, where XXXXX is the parameter code.
#' @return A dataset like \code{data} with selected columns renamed. #' @return A dataset like \code{data} with selected columns renamed.
#' @note The following statistics codes are converted by \code{renameNWISColumns}. See #' @note The following statistics codes are converted by \code{renameNWISColumns}.
#'\url{http://help.waterdata.usgs.gov} for more information about USGS codes.
#'\describe{ #'\describe{
#'\item{00001}{Maximum value, suffix: Max} #'\item{00001}{Maximum value, suffix: Max}
#'\item{00002}{Minimum value, suffix: Min} #'\item{00002}{Minimum value, suffix: Min}
......
...@@ -182,9 +182,7 @@ library(dataRetrieval) ...@@ -182,9 +182,7 @@ library(dataRetrieval)
%------------------------------------------------------------ %------------------------------------------------------------
\section{Introduction to dataRetrieval} \section{Introduction to dataRetrieval}
%------------------------------------------------------------ %------------------------------------------------------------
The dataRetrieval package was created to simplify the process of loading hydrologic data into the R environment. It is designed to retrieve the major data types of U.S. Geological Survey (USGS) hydrologic data that are available on the Web, as well as data from the Water Quality Portal (WQP), which currently houses water quality data from the Environmental Protection Agency (EPA), U.S. Department of Agriculture (USDA), and USGS. Direct USGS data is obtained from a service called the National Water Information System (NWIS). A lot of useful information about NWIS can be obtained here: The dataRetrieval package was created to simplify the process of loading hydrologic data into the R environment. It is designed to retrieve the major data types of U.S. Geological Survey (USGS) hydrologic data that are available on the Web, as well as data from the Water Quality Portal (WQP), which currently houses water quality data from the Environmental Protection Agency (EPA), U.S. Department of Agriculture (USDA), and USGS. Direct USGS data is obtained from a service called the National Water Information System (NWIS).
\url{http://help.waterdata.usgs.gov/}
For information on getting started in R and installing the package, see (\ref{sec:appendix1}): Getting Started. Any use of trade, firm, or product names is for descriptive purposes only and does not imply endorsement by the U.S. Government. For information on getting started in R and installing the package, see (\ref{sec:appendix1}): Getting Started. Any use of trade, firm, or product names is for descriptive purposes only and does not imply endorsement by the U.S. Government.
...@@ -281,13 +279,8 @@ The USGS organizes hydrologic data in a standard structure. Streamgages are loc ...@@ -281,13 +279,8 @@ The USGS organizes hydrologic data in a standard structure. Streamgages are loc
Once the 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}. Once the 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 useful place to discover USGS codes information, along with other NWIS information is:
\url{http://help.waterdata.usgs.gov/codes-and-parameters}
Not every station will measure all parameters. A short list of commonly measured parameters is shown in Table \ref{tab:params}. Not every station will measure all parameters. A short list of commonly measured parameters is shown in Table \ref{tab:params}.
<<tableParameterCodes, echo=FALSE,results='asis'>>= <<tableParameterCodes, echo=FALSE,results='asis'>>=
pCode <- c('00060', '00065', '00010','00045','00400') pCode <- c('00060', '00065', '00010','00045','00400')
shortName <- c("Discharge [ft$^3$/s]","Gage height [ft]","Temperature [C]", "Precipitation [in]", "pH") shortName <- c("Discharge [ft$^3$/s]","Gage height [ft]","Temperature [C]", "Precipitation [in]", "pH")
...@@ -315,9 +308,7 @@ Casrn stands for \enquote{Chemical Abstracts Service (CAS) Registry Number}. Mor ...@@ -315,9 +308,7 @@ Casrn stands for \enquote{Chemical Abstracts Service (CAS) Registry Number}. Mor
\url{http://www.cas.org/content/chemical-substances/faqs} \url{http://www.cas.org/content/chemical-substances/faqs}
For unit values data (sensor data measured at regular time intervals such as 15 minutes or hourly), knowing the parameter code and siteNumber is enough to make a request for data. For most variables that are measured on a continuous basis, the USGS also stores the historical data as daily values. These daily values are statistical summaries of the continuous data, e.g. maximum, minimum, mean, or median. The different statistics are specified by a 5-digit statistics code. A complete list of statistic codes can be found here: For unit values data (sensor data measured at regular time intervals such as 15 minutes or hourly), knowing the parameter code and siteNumber is enough to make a request for data. For most variables that are measured on a continuous basis, the USGS also stores the historical data as daily values. These daily values are statistical summaries of the continuous data, e.g. maximum, minimum, mean, or median. The different statistics are specified by a 5-digit statistics code.
\url{http://help.waterdata.usgs.gov/code/stat_cd_nm_query?stat_nm_cd=%25&fmt=html&inline=true}
Some common codes are shown in Table \ref{tab:stat}. Some common codes are shown in Table \ref{tab:stat}.
...@@ -455,9 +446,6 @@ parameterCd <- "00618" ...@@ -455,9 +446,6 @@ parameterCd <- "00618"
parameterINFO <- readNWISpCode(parameterCd) parameterINFO <- readNWISpCode(parameterCd)
@ @
More information on parameter codes can obtained from:
\url{http://help.waterdata.usgs.gov/codes-and-parameters/parameters}
\FloatBarrier \FloatBarrier
...@@ -481,9 +469,7 @@ discharge <- readNWISdv(siteNumber, ...@@ -481,9 +469,7 @@ discharge <- readNWISdv(siteNumber,
parameterCd, startDate, endDate) parameterCd, startDate, endDate)
@ @
The column \texttt{"}datetime\texttt{"} in the returned data frame is automatically imported as a variable of class \texttt{"}Date\texttt{"} in R. Each requested parameter has a value and remark code column. The names of these columns depend on the requested parameter and stat code combinations. USGS daily value qualification codes are often \texttt{"}A\texttt{"} (approved for publication) or \texttt{"}P\texttt{"} (provisional data subject to revision). A more complete list of daily value qualification codes can be found here: The column \texttt{"}datetime\texttt{"} in the returned data frame is automatically imported as a variable of class \texttt{"}Date\texttt{"} in R. Each requested parameter has a value and remark code column. The names of these columns depend on the requested parameter and stat code combinations. USGS daily value qualification codes are often \texttt{"}A\texttt{"} (approved for publication) or \texttt{"}P\texttt{"} (provisional data subject to revision).
\url{http://help.waterdata.usgs.gov/codes-and-parameters/daily-value-qualification-code-dv_rmk_cd}
Another example would be a request for mean and maximum daily temperature and discharge in early 2012: Another example would be a request for mean and maximum daily temperature and discharge in early 2012:
......
No preview for this file type
...@@ -48,7 +48,6 @@ queryTime \tab POSIXct \tab The time the data was returned \cr ...@@ -48,7 +48,6 @@ queryTime \tab POSIXct \tab The time the data was returned \cr
} }
\description{ \description{
Imports data from NWIS web service. This function gets the data from here: \url{http://waterservices.usgs.gov/} Imports data from NWIS web service. This function gets the data from here: \url{http://waterservices.usgs.gov/}
Information on parameter and statistics codes can be found here: \url{http://help.waterdata.usgs.gov}
} }
\examples{ \examples{
siteNumber <- '04085427' siteNumber <- '04085427'
......
...@@ -44,8 +44,7 @@ function reads information from the header and the arguments in the call to ...@@ -44,8 +44,7 @@ function reads information from the header and the arguments in the call to
to rename those columns. to rename those columns.
} }
\note{ \note{
The following statistics codes are converted by \code{renameNWISColumns}. See The following statistics codes are converted by \code{renameNWISColumns}.
\url{http://help.waterdata.usgs.gov} for more information about USGS codes.
\describe{ \describe{
\item{00001}{Maximum value, suffix: Max} \item{00001}{Maximum value, suffix: Max}
\item{00002}{Minimum value, suffix: Min} \item{00002}{Minimum value, suffix: Min}
......
...@@ -182,9 +182,7 @@ library(dataRetrieval) ...@@ -182,9 +182,7 @@ library(dataRetrieval)
%------------------------------------------------------------ %------------------------------------------------------------
\section{Introduction to dataRetrieval} \section{Introduction to dataRetrieval}
%------------------------------------------------------------ %------------------------------------------------------------
The dataRetrieval package was created to simplify the process of loading hydrologic data into the R environment. It is designed to retrieve the major data types of U.S. Geological Survey (USGS) hydrologic data that are available on the Web, as well as data from the Water Quality Portal (WQP), which currently houses water quality data from the Environmental Protection Agency (EPA), U.S. Department of Agriculture (USDA), and USGS. Direct USGS data is obtained from a service called the National Water Information System (NWIS). A lot of useful information about NWIS can be obtained here: The dataRetrieval package was created to simplify the process of loading hydrologic data into the R environment. It is designed to retrieve the major data types of U.S. Geological Survey (USGS) hydrologic data that are available on the Web, as well as data from the Water Quality Portal (WQP), which currently houses water quality data from the Environmental Protection Agency (EPA), U.S. Department of Agriculture (USDA), and USGS. Direct USGS data is obtained from a service called the National Water Information System (NWIS).
\url{http://help.waterdata.usgs.gov/}
For information on getting started in R and installing the package, see (\ref{sec:appendix1}): Getting Started. Any use of trade, firm, or product names is for descriptive purposes only and does not imply endorsement by the U.S. Government. For information on getting started in R and installing the package, see (\ref{sec:appendix1}): Getting Started. Any use of trade, firm, or product names is for descriptive purposes only and does not imply endorsement by the U.S. Government.
...@@ -281,13 +279,8 @@ The USGS organizes hydrologic data in a standard structure. Streamgages are loc ...@@ -281,13 +279,8 @@ The USGS organizes hydrologic data in a standard structure. Streamgages are loc
Once the 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}. Once the 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 useful place to discover USGS codes information, along with other NWIS information is:
\url{http://help.waterdata.usgs.gov/codes-and-parameters}
Not every station will measure all parameters. A short list of commonly measured parameters is shown in Table \ref{tab:params}. Not every station will measure all parameters. A short list of commonly measured parameters is shown in Table \ref{tab:params}.
<<tableParameterCodes, echo=FALSE,results='asis'>>= <<tableParameterCodes, echo=FALSE,results='asis'>>=
pCode <- c('00060', '00065', '00010','00045','00400') pCode <- c('00060', '00065', '00010','00045','00400')
shortName <- c("Discharge [ft$^3$/s]","Gage height [ft]","Temperature [C]", "Precipitation [in]", "pH") shortName <- c("Discharge [ft$^3$/s]","Gage height [ft]","Temperature [C]", "Precipitation [in]", "pH")
...@@ -315,9 +308,7 @@ Casrn stands for \enquote{Chemical Abstracts Service (CAS) Registry Number}. Mor ...@@ -315,9 +308,7 @@ Casrn stands for \enquote{Chemical Abstracts Service (CAS) Registry Number}. Mor
\url{http://www.cas.org/content/chemical-substances/faqs} \url{http://www.cas.org/content/chemical-substances/faqs}
For unit values data (sensor data measured at regular time intervals such as 15 minutes or hourly), knowing the parameter code and siteNumber is enough to make a request for data. For most variables that are measured on a continuous basis, the USGS also stores the historical data as daily values. These daily values are statistical summaries of the continuous data, e.g. maximum, minimum, mean, or median. The different statistics are specified by a 5-digit statistics code. A complete list of statistic codes can be found here: For unit values data (sensor data measured at regular time intervals such as 15 minutes or hourly), knowing the parameter code and siteNumber is enough to make a request for data. For most variables that are measured on a continuous basis, the USGS also stores the historical data as daily values. These daily values are statistical summaries of the continuous data, e.g. maximum, minimum, mean, or median. The different statistics are specified by a 5-digit statistics code.
\url{http://help.waterdata.usgs.gov/code/stat_cd_nm_query?stat_nm_cd=%25&fmt=html&inline=true}
Some common codes are shown in Table \ref{tab:stat}. Some common codes are shown in Table \ref{tab:stat}.
...@@ -455,9 +446,6 @@ parameterCd <- "00618" ...@@ -455,9 +446,6 @@ parameterCd <- "00618"
parameterINFO <- readNWISpCode(parameterCd) parameterINFO <- readNWISpCode(parameterCd)
@ @
More information on parameter codes can obtained from:
\url{http://help.waterdata.usgs.gov/codes-and-parameters/parameters}
\FloatBarrier \FloatBarrier
...@@ -481,9 +469,7 @@ discharge <- readNWISdv(siteNumber, ...@@ -481,9 +469,7 @@ discharge <- readNWISdv(siteNumber,
parameterCd, startDate, endDate) parameterCd, startDate, endDate)
@ @
The column \texttt{"}datetime\texttt{"} in the returned data frame is automatically imported as a variable of class \texttt{"}Date\texttt{"} in R. Each requested parameter has a value and remark code column. The names of these columns depend on the requested parameter and stat code combinations. USGS daily value qualification codes are often \texttt{"}A\texttt{"} (approved for publication) or \texttt{"}P\texttt{"} (provisional data subject to revision). A more complete list of daily value qualification codes can be found here: The column \texttt{"}datetime\texttt{"} in the returned data frame is automatically imported as a variable of class \texttt{"}Date\texttt{"} in R. Each requested parameter has a value and remark code column. The names of these columns depend on the requested parameter and stat code combinations. USGS daily value qualification codes are often \texttt{"}A\texttt{"} (approved for publication) or \texttt{"}P\texttt{"} (provisional data subject to revision).
\url{http://help.waterdata.usgs.gov/codes-and-parameters/daily-value-qualification-code-dv_rmk_cd}
Another example would be a request for mean and maximum daily temperature and discharge in early 2012: Another example would be a request for mean and maximum daily temperature and discharge in early 2012:
......
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