Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Water
dataRetrieval
Commits
0405cfba
Unverified
Commit
0405cfba
authored
Dec 20, 2021
by
Laura A DeCicco
Committed by
GitHub
Dec 20, 2021
Browse files
Merge pull request #594 from ldecicco-USGS/master
single pcodes are different
parents
6177e51f
4692758d
Changes
2
Hide whitespace changes
Inline
Side-by-side
R/readNWISpCode.r
View file @
0405cfba
...
...
@@ -34,10 +34,10 @@ readNWISpCode <- function(parameterCd){
parameterCd
<-
parameterCd
[
!
is.na
(
parameterCd
)]
baseURL
<-
drURL
(
"pCode"
,
Access
=
pkg.env
$
access
)
fullURL
<-
paste0
(
baseURL
,
"fmt=rdb&group_cd=%"
)
if
(
any
(
parameterCd
==
"all"
)){
temp_df
<-
importRDB1
(
fullURL
,
asDateTime
=
FALSE
)
parameterData
<-
data.frame
(
parameter_cd
=
temp_df
$
parm_cd
,
...
...
@@ -54,7 +54,12 @@ readNWISpCode <- function(parameterCd){
parameterData
<-
parameterCdFile
[
parameterCdFile
$
parameter_cd
%in%
parameterCd
,]
if
(
nrow
(
parameterData
)
!=
length
(
parameterCd
)){
if
(
nrow
(
parameterData
)
>
0
){
parameterCd
<-
parameterCd
[
!
parameterCd
%in%
unique
(
parameterData
$
parameter_cd
)]
}
if
(
length
(
parameterCd
)
==
1
){
baseURL
<-
drURL
(
"pCodeSingle"
,
Access
=
pkg.env
$
access
)
subURL
<-
paste0
(
baseURL
,
"fmt=rdb&parm_nm_cd="
,
parameterCd
)
temp_df
<-
importRDB1
(
subURL
,
asDateTime
=
FALSE
)
parameterData
<-
data.frame
(
...
...
R/setAccess.R
View file @
0405cfba
...
...
@@ -53,6 +53,7 @@ setAccess = function(access="public"){
pkg.env
$
stat
=
"https://waterservices.usgs.gov/nwis/stat/"
pkg.env
$
useNat
=
"https://waterdata.usgs.gov/nwis/water_use"
pkg.env
$
pCode
=
"https://help.waterdata.usgs.gov/code/parameter_cd_query"
pkg.env
$
pCodeSingle
=
"https://help.waterdata.usgs.gov/code/parameter_cd_nm_query"
# NOTE: state water use are still in: constructUseURL
pkg.env
$
Result
=
"https://www.waterqualitydata.us/data/Result/search"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment