Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dataRetrieval
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Water
dataRetrieval
Commits
04206eea
Commit
04206eea
authored
10 years ago
by
Laura A DeCicco
Browse files
Options
Downloads
Patches
Plain Diff
Improved help files.
parent
e8479185
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!51
Fixed multi-pcode WQP call bug.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/readNWISunit.r
+24
-9
24 additions, 9 deletions
R/readNWISunit.r
R/readWQPdata.R
+9
-0
9 additions, 0 deletions
R/readWQPdata.R
with
33 additions
and
9 deletions
R/readNWISunit.r
+
24
−
9
View file @
04206eea
...
...
@@ -66,7 +66,8 @@ readNWISuv <- function (siteNumbers,parameterCd,startDate="",endDate="", tz=""){
#' Reads peak flow data from NWISweb.
#'
#'
#' Reads peak flow from NWISweb.
#' Data is retrieved from \url{http://waterdata.usgs.gov/nwis}.
#'
#' @param siteNumber character USGS site number. This is usually an 8 digit number
#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates
...
...
@@ -78,11 +79,17 @@ readNWISuv <- function (siteNumbers,parameterCd,startDate="",endDate="", tz=""){
#' Name \tab Type \tab Description \cr
#' agency_cd \tab character \tab The NWIS code for the agency reporting the data\cr
#' site_no \tab character \tab The USGS site number \cr
#' dateTime \tab POSIXct \tab The date and time of the value converted to UTC (if asDateTime = TRUE), \cr
#' \tab character \tab or raw character string (if asDateTime = FALSE) \cr
#' tz_cd \tab character \tab The time zone code for dateTime \cr
#' code \tab character \tab Any codes that qualify the corresponding value\cr
#' value \tab numeric \tab The numeric value for the parameter \cr
#' peak_dt \tab Date \tab Date of peak streamflow \cr
#' peak_tm \tab character \tab Time of peak streamflow as character \cr
#' peak_va \tab numeric \tab Annual peak streamflow value in cfs \cr
#' peak_cd \tab character \tab Peak Discharge-Qualification codes (see \code{comment} for more information) \cr
#' gage_ht \tab numeric \tab Gage height for the associated peak streamflow in feet \cr
#' gage_ht_cd \tab character \tab Gage height qualification codes \cr
#' year_last_pk \tab character \tab Peak streamflow reported is the highest since this year \cr
#' ag_dt \tab character \tab Date of maximum gage-height for water year (if not concurrent with peak) \cr
#' ag_tm \tab character \tab Time of maximum gage-height for water year (if not concurrent with peak) \cr
#' ag_gage_ht \tab character \tab maximum Gage height for water year in feet (if not concurrent with peak) \cr
#' ag_gage_ht_cd \tab character \tab maximum Gage height code \cr
#' }
#'
#' There are also several useful attributes attached to the data frame:
...
...
@@ -103,6 +110,10 @@ readNWISpeak <- function (siteNumber,startDate="",endDate=""){
url
<-
constructNWISURL
(
siteNumber
,
NA
,
startDate
,
endDate
,
"peak"
)
data
<-
importRDB1
(
url
,
asDateTime
=
FALSE
)
data
$
peak_dt
<-
as.Date
(
data
$
peak_dt
)
data
$
gage_ht
<-
as.numeric
(
data
$
gage_ht
)
siteInfo
<-
readNWISsite
(
siteNumber
)
attr
(
data
,
"siteInfo"
)
<-
siteInfo
...
...
@@ -114,7 +125,8 @@ readNWISpeak <- function (siteNumber,startDate="",endDate=""){
#' Reads the current rating table for an active USGS streamgage.
#'
#'
#' Reads current rating table for an active USGS streamgage from NWISweb.
#' Data is retrieved from \url{http://waterdata.usgs.gov/nwis}.
#'
#' @param siteNumber character USGS site number. This is usually an 8 digit number
#' @param type character can be "base", "corr", or "exsa"
...
...
@@ -160,7 +172,8 @@ readNWISrating <- function (siteNumber,type="base"){
#'Reads surface-water measurement data from NWISweb.
#'
#'
#'Reads surface-water measurement data from NWISweb. Data is retrieved from \url{http://waterdata.usgs.gov/nwis}.
#'See \url{http://waterdata.usgs.gov/usa/nwis/sw} for details about surface water.
#'
#' @param siteNumber character USGS site number. This is usually an 8 digit number
#' @param startDate character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates
...
...
@@ -179,7 +192,9 @@ readNWISrating <- function (siteNumber,type="base"){
#' tz_cd \tab character \tab The time zone code for dateTime \cr
#' }
#'
#' See \url{http://waterdata.usgs.gov/usa/nwis/sw} for details about surface water.
#' See \url{http://waterdata.usgs.gov/usa/nwis/sw} for details about surface water, and
#' \url{http://waterdata.usgs.gov/nwis/help?output_formats_help#streamflow_measurement_data}
#' for help on the columns and codes.
#'
#' There are also several useful attributes attached to the data frame:
#' \tabular{lll}{
...
...
This diff is collapsed.
Click to expand it.
R/readWQPdata.R
+
9
−
0
View file @
04206eea
...
...
@@ -7,6 +7,15 @@
#' @keywords data import WQP 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)
#'
#' There are also several useful attributes attached to the data frame:
#' \tabular{lll}{
#' Name \tab Type \tab Description \cr
#' url \tab character \tab The url used to generate the data \cr
#' siteInfo \tab data.frame \tab A data frame containing information on the requested sites \cr
#' variableInfo \tab data.frame \tab A data frame containing information on the requested parameters \cr
#' queryTime \tab POSIXct \tab The time the data was returned \cr
#' }
#' @export
#' @examples
#' \dontrun{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment