Skip to content

Commit

Permalink
Merge pull request #674 from ldecicco-USGS/main
Browse files Browse the repository at this point in the history
Add NMC links to readme
  • Loading branch information
ldecicco-USGS authored Sep 20, 2023
2 parents b920321 + 6b39008 commit e3272cb
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ jobs:
steps:
- uses: actions/checkout@c0a81a463886bb75afe234e07a9fd5bb79219196

- uses: r-lib/actions/setup-pandoc@52330cc136b963487918a8867f948ddf954e9e63
- uses: r-lib/actions/setup-pandoc@756399d909bf9c180bbdafe8025f794f51f2da02

- uses: r-lib/actions/setup-r@52330cc136b963487918a8867f948ddf954e9e63
- uses: r-lib/actions/setup-r@756399d909bf9c180bbdafe8025f794f51f2da02
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@52330cc136b963487918a8867f948ddf954e9e63
- uses: r-lib/actions/setup-r-dependencies@756399d909bf9c180bbdafe8025f794f51f2da02
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@52330cc136b963487918a8867f948ddf954e9e63
- uses: r-lib/actions/check-r-package@756399d909bf9c180bbdafe8025f794f51f2da02
with:
upload-snapshots: true
26 changes: 5 additions & 21 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,14 @@ jobs:
steps:
- uses: actions/checkout@c0a81a463886bb75afe234e07a9fd5bb79219196

- uses: r-lib/actions/setup-r@52330cc136b963487918a8867f948ddf954e9e63
- uses: r-lib/actions/setup-r@756399d909bf9c180bbdafe8025f794f51f2da02

- uses: r-lib/actions/setup-pandoc@52330cc136b963487918a8867f948ddf954e9e63
- uses: r-lib/actions/setup-pandoc@756399d909bf9c180bbdafe8025f794f51f2da02

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
- uses: r-lib/actions/setup-r-dependencies@756399d909bf9c180bbdafe8025f794f51f2da02
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-4.0-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.0-2-

- name: Install dependencies
run: |
options(pkgType = "binary")
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Test coverage
run: covr::codecov()
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ getready:
stage: getready
script:
- mkdir -p $R_LIBS_USER
- Rscript -e "install.packages(c('stringi', 'devtools','pkgdown', 'connectapi', 'patchwork'))"
- Rscript -e "install.packages(c('rlang', 'stringi', 'devtools','pkgdown', 'connectapi', 'patchwork'))"
- Rscript -e "devtools::install_deps(dependencies = TRUE, quiet = TRUE)"
cache:
paths:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrology and Water Quality Data
Version: 2.7.12
Version: 2.7.13
Authors@R: c(
person("Laura", "DeCicco", role = c("aut","cre"),
email = "[email protected]",
Expand Down Expand Up @@ -40,7 +40,7 @@ Imports:
stats,
utils,
xml2,
readr (>= 1.0.0),
readr (>= 1.4.0),
jsonlite
Suggests:
covr,
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
dataRetrieval 2.7.13
===================
* Added pcode_to_name function to get WQP characteristics from USGS parameter codes.
* Required readr version 1.4 or greater

dataRetrieval 2.7.12
===================
Expand Down
2 changes: 1 addition & 1 deletion R/findNLDI.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ valid_ask <- function(all, type) {

#' @title R Client for the Network Linked Data Index
#' @description Provides a formal client to the USGS
#' \href{https://labs.waterdata.usgs.gov/about-nldi/index.html}{Network Linked Data Index}.
#' Network Linked Data Index.
#' @details The function is useful for topology and location based
#' feature discovery. A user must specify an origin feature, optional navigation
#' direction(s) along the network, as well as features to identify along the
Expand Down
6 changes: 3 additions & 3 deletions R/importRDB1.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ importRDB1 <- function(obs_url,
skip = meta.rows + 2,
col_names = FALSE
)
if (utils::packageVersion("readr") > 1.4) {
args_list[["show_col_types"]] <- FALSE
}

args_list[["show_col_types"]] <- FALSE

if (convertType) {
args_list[["guess_max"]] <- data.rows
args_list[["col_types"]] <- readr::cols()
Expand Down
8 changes: 8 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ knitr::opts_chunk$set(

# dataRetrieval <img src="man/figures/hex_logo.png" class="logo" alt="dataRetrieval" style="width:90px;height:auto;" align="right" />

[![CRAN version](http://www.r-pkg.org/badges/version/dataRetrieval)](https://cran.r-project.org/package=EGRET)
[![](http://cranlogs.r-pkg.org/badges/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval)
[![](http://cranlogs.r-pkg.org/badges/grand-total/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval)

The `dataRetrieval` package was created to simplify the process of loading hydrologic data into the R environment. It is designed to retrieve the major data types of U.S. Geological Survey (USGS) hydrology data that are available on the Web, as well as data from the Water Quality Portal (WQP), which currently houses water quality data from the Environmental Protection Agency (EPA), U.S. Department of Agriculture (USDA), and USGS. Direct USGS data is obtained from a service called the National Water Information System (NWIS).

For complete tutorial information, see:
Expand All @@ -28,6 +32,10 @@ For complete tutorial information, see:

[https://waterdata.usgs.gov/blog/dataretrieval/](https://waterdata.usgs.gov/blog/dataretrieval/)

[dataRetrieval Introduction 1](https://rconnect.usgs.gov/NMC_dataRetrieval_1)

[dataRetrieval Introduction 2](https://rconnect.usgs.gov/NMC_dataRetrieval_2)


# Sample Workflow

Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# dataRetrieval <img src="man/figures/hex_logo.png" class="logo" alt="dataRetrieval" style="width:90px;height:auto;" align="right" />

[![CRAN
version](http://www.r-pkg.org/badges/version/dataRetrieval)](https://cran.r-project.org/package=EGRET)
[![](http://cranlogs.r-pkg.org/badges/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval)
[![](http://cranlogs.r-pkg.org/badges/grand-total/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval)

The `dataRetrieval` package was created to simplify the process of
loading hydrologic data into the R environment. It is designed to
retrieve the major data types of U.S. Geological Survey (USGS) hydrology
Expand All @@ -15,6 +20,12 @@ For complete tutorial information, see:

<https://waterdata.usgs.gov/blog/dataretrieval/>

[dataRetrieval Introduction
1](https://rconnect.usgs.gov/NMC_dataRetrieval_1)

[dataRetrieval Introduction
2](https://rconnect.usgs.gov/NMC_dataRetrieval_2)

# Sample Workflow

## USGS
Expand Down Expand Up @@ -92,24 +103,23 @@ Please consider reporting bugs and asking questions on the Issues page:

``` r
citation(package = "dataRetrieval")
#>
#> To cite dataRetrieval in publications, please use:
#>
#> De Cicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M.,
#> 2022, dataRetrieval: R packages for discovering and retrieving water
#> data available from Federal hydrologic web services, v.2.7.12,
#> 2023, dataRetrieval: R packages for discovering and retrieving water
#> data available from Federal hydrologic web services, v.2.7.13,
#> doi:10.5066/P9X4L3GE
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> author = {Laura A. {De Cicco} and David Lorenz and Robert M. Hirsch and William Watkins and Mike Johnson},
#> author = {Laura DeCicco and Robert Hirsch and David Lorenz and David Watkins and Mike Johnson},
#> title = {dataRetrieval: R packages for discovering and retrieving water data available from U.S. federal hydrologic web services},
#> publisher = {U.S. Geological Survey},
#> address = {Reston, VA},
#> version = {2.7.12},
#> version = {2.7.13},
#> institution = {U.S. Geological Survey},
#> year = {2022},
#> year = {2023},
#> doi = {10.5066/P9X4L3GE},
#> url = {https://code.usgs.gov/water/dataRetrieval},
#> }
Expand Down
26 changes: 16 additions & 10 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
citHeader("To cite dataRetrieval in publications, please use:")

bibentry(bibtype = "Manual",
author = personList(
as.person("Laura A. De Cicco"),
as.person("David Lorenz"),
as.person("Robert M. Hirsch"),
as.person("William Watkins"),
as.person("Mike Johnson")
),
author = c(
person("Laura", "DeCicco", role = c("aut","cre"),
email = "[email protected]",
comment=c(ORCID="0000-0002-3915-9487")),
person("Robert", "Hirsch", role = c("aut"),
comment=c(ORCID="0000-0002-4534-075X")),
person("David","Lorenz", role=c("aut")),
person("David","Watkins", role=c("aut"),
email = "[email protected]",
comment=c(ORCID="0000-0002-7544-0700")),
person("Mike", "Johnson", role=c("aut"),
email = "[email protected]",
comment=c(ORCID="0000-0002-5288-8350"))),
title = "dataRetrieval: R packages for discovering and retrieving water data available from U.S. federal hydrologic web services",
publisher = "U.S. Geological Survey",
address="Reston, VA",
version = "2.7.12",
version = "2.7.13",
institution = "U.S. Geological Survey",
year = 2022,
year = 2023,
doi = "10.5066/P9X4L3GE",
url = "https://code.usgs.gov/water/dataRetrieval",
textVersion = "De Cicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M., 2022, dataRetrieval: R packages for discovering and retrieving water data available from Federal hydrologic web services, v.2.7.12, doi:10.5066/P9X4L3GE"
textVersion = "De Cicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M., 2023, dataRetrieval: R packages for discovering and retrieving water data available from Federal hydrologic web services, v.2.7.13, doi:10.5066/P9X4L3GE"
)
2 changes: 1 addition & 1 deletion man/findNLDI.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/tests_imports.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test_that("External importRDB1 tests", {
))
site_data <- importRDB1(url)

expect_equal(site_data$station_nm, "\"G\" CANAL NEAR OLENE,OREG.")
expect_equal(site_data$station_nm, "G CANAL NEAR OLENE, OR")

site <- "040854588204"

Expand All @@ -74,7 +74,7 @@ test_that("External importRDB1 tests", {
))
site_data <- importRDB1(url)

expect_equal(site_data$station_nm, "\"FISHER CR AT 32 & HIGHLAND RD AT HOWARDS GROVE, W")
expect_equal(site_data$station_nm, "FISHER CR AT 32 & HIGHLAND RD AT HOWARDS GROVE, W")
})

context("importRDB")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/tests_nldi.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test_that("NLDI starting sources...", {
# GENERAL START: STABLE
expect_equal(findNLDI(origin = list("comid" = 101), warn = FALSE)$origin$sourceName, "NHDPlus comid")
# GENERAL START: NON-STABLE
expect_equal(findNLDI(origin = list("wade" = "NMwr_S148023"), warn = FALSE)$origin$sourceName, "Water Data Exchange 2.0 Sites")
expect_equal(findNLDI(origin = list("nwissite" = "USGS-05427850"), warn = FALSE)$origin$sourceName, "NWIS Surface Water Sites")
# ERROR: TWO STARTS
expect_error(findNLDI(nwis = 1000, comid = 101, warn = FALSE))
# NON EXISTING SITE
Expand Down

0 comments on commit e3272cb

Please sign in to comment.