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

Removing last bit of calls to services.

parent cdb56859
No related branches found
No related tags found
1 merge request!135Minimize examples to web services
......@@ -2,7 +2,7 @@ Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.3.1
Date: 2015-07-17
Date: 2015-08-13
Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
email = "rhirsch@usgs.gov"),
person("Laura", "DeCicco", role = c("aut","cre"),
......@@ -36,4 +36,5 @@ Suggests:
testthat
VignetteBuilder: knitr
BuildVignettes: true
BugReports: https://github.com/USGS-R/dataRetrieval/issues
URL: https://github.com/USGS-R/dataRetrieval, http://pubs.usgs.gov/tm/04/a10/
......@@ -241,18 +241,15 @@ legend("topleft", variableInfo$param_units,
# parameterCd=c("00010","00060"),
# hasDataTypeCd="dv")
## ----dataExample------------------------------------------
dischargeWI <- readNWISdata(service="dv",
stateCd="WI",
parameterCd="00060",
drainAreaMin="50",
statCd="00003")
names(dischargeWI)
nrow(dischargeWI)
siteInfo <- attr(dischargeWI, "siteInfo")
head(siteInfo)
## ----dataExample, eval=FALSE------------------------------
# dischargeWI <- readNWISdata(service="dv",
# stateCd="WI",
# parameterCd="00060",
# drainAreaMin="50",
# statCd="00003")
#
# siteInfo <- attr(dischargeWI, "siteInfo")
#
## ----NJChloride, eval=FALSE-------------------------------
#
......@@ -266,28 +263,27 @@ head(siteInfo)
# characteristicName="pH")
#
## ----meta1, eval=TRUE-------------------------------------
attr(dischargeWI, "url")
attr(dischargeWI, "queryTime")
siteInfo <- attr(dischargeWI, "siteInfo")
## ----meta2, eval=TRUE-------------------------------------
names(attributes(dischargeWI))
## ----meta3, eval=TRUE-------------------------------------
siteInfo <- attr(dischargeWI, "siteInfo")
head(siteInfo)
variableInfo <- attr(dischargeWI, "variableInfo")
## ----meta1, eval=FALSE------------------------------------
#
# attr(dischargeWI, "url")
#
# attr(dischargeWI, "queryTime")
#
# siteInfo <- attr(dischargeWI, "siteInfo")
#
## ----meta2, eval=FALSE------------------------------------
#
# names(attributes(dischargeWI))
#
## ----meta3, eval=FALSE------------------------------------
#
# siteInfo <- attr(dischargeWI, "siteInfo")
#
# variableInfo <- attr(dischargeWI, "variableInfo")
#
#
## ----meta5, eval=FALSE------------------------------------
# comment(peakData)
......
......@@ -2,7 +2,7 @@
%\VignetteEngine{knitr::knitr}
%\VignetteDepends{}
%\VignetteSuggests{xtable, testthat}
%\VignetteImports{XML, RCurl, reshape2,lubridate,plyr}
%\VignetteImports{XML, RCurl, reshape2,lubridate,plyr,utils,stats}
%\VignettePackage{dataRetrieval}
\documentclass[a4paper,11pt]{article}
......@@ -757,17 +757,14 @@ For NWIS data, the function \texttt{readNWISdata} can be used. The argument list
The \texttt{"..."} argument allows the user to create their own queries based on the instructions found in the web links above. The links provide instructions on how to create a URL to request data. Perhaps you want sites only in Wisconsin, with a drainage area less than 50 mi$^2$, and the most recent daily dischage data. That request would be done as follows:
<<dataExample>>=
<<dataExample, eval=FALSE>>=
dischargeWI <- readNWISdata(service="dv",
stateCd="WI",
parameterCd="00060",
drainAreaMin="50",
statCd="00003")
names(dischargeWI)
nrow(dischargeWI)
siteInfo <- attr(dischargeWI, "siteInfo")
head(siteInfo)
@
......@@ -815,7 +812,7 @@ dataPH <- readWQPdata(statecode="US:55",
%------------------------------------------------------------
All data frames returned from the Web services have some form of associated metadata. This information is included as attributes to the data frame. All data frames will have a \texttt{url} (returning a character of the url used to obtain the data), \texttt{siteInfo} (returning a data frame with information on sites), and \texttt{queryTime} (returning a POSIXct datetime) attributes. For example, the url and query time used to obtain the data can be found as follows:
<<meta1, eval=TRUE>>=
<<meta1, eval=FALSE>>=
attr(dischargeWI, "url")
......@@ -827,7 +824,7 @@ siteInfo <- attr(dischargeWI, "siteInfo")
Depending on the format that the data was obtained (RDB, WaterML1, etc), there will be additional information embedded in the data frame as attributes. To discover the available attributes:
<<meta2, eval=TRUE>>=
<<meta2, eval=FALSE>>=
names(attributes(dischargeWI))
......@@ -835,10 +832,9 @@ names(attributes(dischargeWI))
For data obtained from \texttt{readNWISuv}, \texttt{readNWISdv}, \texttt{readNWISgwl} there are two attributes that are particularly useful: \texttt{siteInfo} and \texttt{variableInfo}.
<<meta3, eval=TRUE>>=
<<meta3, eval=FALSE>>=
siteInfo <- attr(dischargeWI, "siteInfo")
head(siteInfo)
variableInfo <- attr(dischargeWI, "variableInfo")
......
No preview for this file type
......@@ -757,17 +757,14 @@ For NWIS data, the function \texttt{readNWISdata} can be used. The argument list
The \texttt{"..."} argument allows the user to create their own queries based on the instructions found in the web links above. The links provide instructions on how to create a URL to request data. Perhaps you want sites only in Wisconsin, with a drainage area less than 50 mi$^2$, and the most recent daily dischage data. That request would be done as follows:
<<dataExample>>=
<<dataExample, eval=FALSE>>=
dischargeWI <- readNWISdata(service="dv",
stateCd="WI",
parameterCd="00060",
drainAreaMin="50",
statCd="00003")
names(dischargeWI)
nrow(dischargeWI)
siteInfo <- attr(dischargeWI, "siteInfo")
head(siteInfo)
@
......@@ -815,7 +812,7 @@ dataPH <- readWQPdata(statecode="US:55",
%------------------------------------------------------------
All data frames returned from the Web services have some form of associated metadata. This information is included as attributes to the data frame. All data frames will have a \texttt{url} (returning a character of the url used to obtain the data), \texttt{siteInfo} (returning a data frame with information on sites), and \texttt{queryTime} (returning a POSIXct datetime) attributes. For example, the url and query time used to obtain the data can be found as follows:
<<meta1, eval=TRUE>>=
<<meta1, eval=FALSE>>=
attr(dischargeWI, "url")
......@@ -827,7 +824,7 @@ siteInfo <- attr(dischargeWI, "siteInfo")
Depending on the format that the data was obtained (RDB, WaterML1, etc), there will be additional information embedded in the data frame as attributes. To discover the available attributes:
<<meta2, eval=TRUE>>=
<<meta2, eval=FALSE>>=
names(attributes(dischargeWI))
......@@ -835,10 +832,9 @@ names(attributes(dischargeWI))
For data obtained from \texttt{readNWISuv}, \texttt{readNWISdv}, \texttt{readNWISgwl} there are two attributes that are particularly useful: \texttt{siteInfo} and \texttt{variableInfo}.
<<meta3, eval=TRUE>>=
<<meta3, eval=FALSE>>=
siteInfo <- attr(dischargeWI, "siteInfo")
head(siteInfo)
variableInfo <- attr(dischargeWI, "variableInfo")
......
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