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
96a51503
Commit
96a51503
authored
11 years ago
by
Laura A DeCicco
Browse files
Options
Downloads
Patches
Plain Diff
Added interaction option to retrieveNWIS functions.
parent
f2576a29
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
R/retrieveNWISData.r
+1
-1
1 addition, 1 deletion
R/retrieveNWISData.r
R/retrieveNWISqwData.r
+3
-2
3 additions, 2 deletions
R/retrieveNWISqwData.r
R/retrieveUnitNWISData.r
+1
-1
1 addition, 1 deletion
R/retrieveUnitNWISData.r
man/retrieveNWISqwData.Rd
+5
-1
5 additions, 1 deletion
man/retrieveNWISqwData.Rd
with
10 additions
and
5 deletions
R/retrieveNWISData.r
+
1
−
1
View file @
96a51503
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#' rawDailyQAndTempMeanMax <- retrieveNWISData(siteNumber,c('00010','00060'), startDate, endDate, StatCd=c('00001','00003'))
#' rawDailyQAndTempMeanMax <- retrieveNWISData(siteNumber,c('00010','00060'), startDate, endDate, StatCd=c('00001','00003'))
retrieveNWISData
<-
function
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
StatCd
=
"00003"
,
format
=
"tsv"
,
interactive
=
TRUE
){
retrieveNWISData
<-
function
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
StatCd
=
"00003"
,
format
=
"tsv"
,
interactive
=
TRUE
){
url
<-
constructNWISURL
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
"dv"
,
statCd
=
StatCd
,
format
=
format
)
url
<-
constructNWISURL
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
"dv"
,
statCd
=
StatCd
,
format
=
format
,
interactive
=
interactive
)
if
(
format
==
"xml"
)
{
if
(
format
==
"xml"
)
{
data
<-
getWaterML1Data
(
url
)
data
<-
getWaterML1Data
(
url
)
...
...
This diff is collapsed.
Click to expand it.
R/retrieveNWISqwData.r
+
3
−
2
View file @
96a51503
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#' @param pCodes string or vector of USGS parameter code. This is usually an 5 digit number.
#' @param pCodes string or vector of USGS parameter code. This is usually an 5 digit number.
#' @param startDate string starting date for data retrieval in the form YYYY-MM-DD.
#' @param startDate string starting date for data retrieval in the form YYYY-MM-DD.
#' @param endDate string ending date for data retrieval in the form YYYY-MM-DD.
#' @param endDate string ending date for data retrieval in the form YYYY-MM-DD.
#' @param interactive logical Option for interactive mode. If true, there is user interaction for error handling and data checks.
#' @keywords data import USGS web service
#' @keywords data import USGS web service
#' @return data dataframe with agency, site, dateTime, value, and code columns
#' @return data dataframe with agency, site, dateTime, value, and code columns
#' @export
#' @export
...
@@ -23,9 +24,9 @@
...
@@ -23,9 +24,9 @@
#' data$dateTime <- as.Date(data$dateTime)
#' data$dateTime <- as.Date(data$dateTime)
#' compressedData <- compressData(data)
#' compressedData <- compressData(data)
#' Sample <- populateSampleColumns(compressedData)
#' Sample <- populateSampleColumns(compressedData)
retrieveNWISqwData
<-
function
(
siteNumber
,
pCodes
,
startDate
,
endDate
){
retrieveNWISqwData
<-
function
(
siteNumber
,
pCodes
,
startDate
,
endDate
,
interactive
=
TRUE
){
url
<-
constructNWISURL
(
siteNumber
,
pCodes
,
startDate
,
endDate
,
"qw"
)
url
<-
constructNWISURL
(
siteNumber
,
pCodes
,
startDate
,
endDate
,
"qw"
,
interactive
=
interactive
)
tmp
<-
read.delim
(
tmp
<-
read.delim
(
url
,
url
,
...
...
This diff is collapsed.
Click to expand it.
R/retrieveUnitNWISData.r
+
1
−
1
View file @
96a51503
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#' rawData2 <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate,"tsv")
#' rawData2 <- retrieveUnitNWISData(siteNumber,ParameterCd,StartDate,EndDate,"tsv")
retrieveUnitNWISData
<-
function
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
format
=
"xml"
,
interactive
=
TRUE
){
retrieveUnitNWISData
<-
function
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
format
=
"xml"
,
interactive
=
TRUE
){
url
<-
constructNWISURL
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
"uv"
,
format
=
format
)
url
<-
constructNWISURL
(
siteNumber
,
ParameterCd
,
StartDate
,
EndDate
,
"uv"
,
format
=
format
,
interactive
=
interactive
)
if
(
format
==
"xml"
)
{
if
(
format
==
"xml"
)
{
data
<-
getWaterML1Data
(
url
)
data
<-
getWaterML1Data
(
url
)
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
man/retrieveNWISqwData.Rd
+
5
−
1
View file @
96a51503
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
\title{Raw Data Import for USGS NWIS QW Data}
\title{Raw Data Import for USGS NWIS QW Data}
\usage{
\usage{
retrieveNWISqwData(siteNumber, pCodes, startDate,
retrieveNWISqwData(siteNumber, pCodes, startDate,
endDate)
endDate
, interactive = TRUE
)
}
}
\arguments{
\arguments{
\item{siteNumber}{string or vector of strings USGS site
\item{siteNumber}{string or vector of strings USGS site
...
@@ -17,6 +17,10 @@
...
@@ -17,6 +17,10 @@
\item{endDate}{string ending date for data retrieval in
\item{endDate}{string ending date for data retrieval in
the form YYYY-MM-DD.}
the form YYYY-MM-DD.}
\item{interactive}{logical Option for interactive mode.
If true, there is user interaction for error handling and
data checks.}
}
}
\value{
\value{
data dataframe with agency, site, dateTime, value, and
data dataframe with agency, site, dateTime, value, and
...
...
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