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
de25c7a9
Commit
de25c7a9
authored
10 years ago
by
Laura A DeCicco
Browse files
Options
Downloads
Patches
Plain Diff
Added generalized getNWISData function.
parent
dffb7be4
No related branches found
No related tags found
1 merge request
!11
Added generalized NWIS data function, and functionality to WQP raw pulls (datetimes).
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NAMESPACE
+1
-0
1 addition, 0 deletions
NAMESPACE
R/getNWISData.r
+31
-0
31 additions, 0 deletions
R/getNWISData.r
man/getNWISData.Rd
+28
-0
28 additions, 0 deletions
man/getNWISData.Rd
with
60 additions
and
0 deletions
NAMESPACE
+
1
−
0
View file @
de25c7a9
...
...
@@ -15,6 +15,7 @@ export(getDataAvailability)
export(getDataFromFile)
export(getGeneralWQPData)
export(getMetaData)
export(getNWISData)
export(getNWISSites)
export(getParameterInfo)
export(getQWDataFromFile)
...
...
This diff is collapsed.
Click to expand it.
R/getNWISData.r
0 → 100644
+
31
−
0
View file @
de25c7a9
#' General Data Import from NWIS
#'
#' Returns data from the NWIS web service.
#' Arguments to the function should be based on \url{http://waterservices.usgs.gov/rest/Site-Service.html#Service}
#'
#' @param service string
#' @param \dots see \url{http://waterservices.usgs.gov/rest/Site-Service.html#Service} for a complete list of options
#' @keywords data import NWIS web service
#' @return retval dataframe
#' @export
#' @examples
#' dataTemp <- getNWISData(stateCd="OH",parameterCd="00010")
getNWISData
<-
function
(
service
=
"dv"
,
...
){
matchReturn
<-
match.call
()
values
<-
sapply
(
matchReturn
[
-1
],
function
(
x
)
URLencode
(
as.character
(
paste
(
eval
(
x
),
collapse
=
""
,
sep
=
""
))))
urlCall
<-
paste
(
paste
(
names
(
values
),
values
,
sep
=
"="
),
collapse
=
"&"
)
baseURL
<-
paste0
(
"http://waterservices.usgs.gov/nwis/"
,
service
,
"/?format=rdb&"
)
urlCall
<-
paste0
(
baseURL
,
urlCall
)
if
(
service
==
"qw"
){
urlCall
<-
paste0
(
urlCall
,
"&siteOutput=expanded"
)
}
retval
<-
getRDB1Data
(
urlCall
)
return
(
retval
)
}
This diff is collapsed.
Click to expand it.
man/getNWISData.Rd
0 → 100644
+
28
−
0
View file @
de25c7a9
% Generated by roxygen2 (4.0.2): do not edit by hand
\name{getNWISData}
\alias{getNWISData}
\title{General Data Import from NWIS}
\usage{
getNWISData(service = "dv", ...)
}
\arguments{
\item{services}{string}
\item{\dots}{see \url{http://waterservices.usgs.gov/rest/Site-Service.html#Service} for a complete list of options}
}
\value{
retval dataframe
}
\description{
Returns data from the NWIS web service.
Arguments to the function should be based on \url{http://waterservices.usgs.gov/rest/Site-Service.html#Service}
}
\examples{
dataTemp <- getNWISData(stateCd="OH",parameterCd="00010")
}
\keyword{NWIS}
\keyword{data}
\keyword{import}
\keyword{service}
\keyword{web}
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