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
a57a6d40
Commit
a57a6d40
authored
Nov 01, 2021
by
Blodgett, David L.
Browse files
add name, reachcode, and measure as valid names from NLDI
parent
c4a59776
Changes
2
Hide whitespace changes
Inline
Side-by-side
R/findNLDI.R
View file @
a57a6d40
...
...
@@ -23,7 +23,8 @@ find_good_names = function(input, type) {
if
(
type
==
"nav"
)
{
grep
(
"comid"
,
names
(
input
),
value
=
TRUE
)
}
else
if
(
type
==
"feature"
)
{
c
(
"sourceName"
,
"identifier"
,
"comid"
)
c
(
"sourceName"
,
"identifier"
,
"comid"
,
names
(
input
)[
names
(
input
)
%in%
c
(
"name"
,
"reachcode"
,
"measure"
)])
}
else
{
NULL
}
...
...
tests/testthat/tests_nldi.R
View file @
a57a6d40
...
...
@@ -15,7 +15,8 @@ test_that("NLDI starting sources...", {
# POINT GEOMETERY
expect_equal
(
sum
(
names
(
findNLDI
(
nwis
=
'11120000'
))
==
c
(
'sourceName'
,
'identifier'
,
"comid"
,
"X"
,
"Y"
,
"geometry"
)),
6
)
"name"
,
"reachcode"
,
"measure"
,
"X"
,
"Y"
,
"geometry"
)),
9
)
# COMID
expect_equal
(
findNLDI
(
comid
=
101
)
$
sourceName
,
"NHDPlus comid"
)
# NWIS
...
...
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