Skip to content

Commit

Permalink
Merge pull request #87 from dblodgett-usgs/master
Browse files Browse the repository at this point in the history
On CRAN!!!
  • Loading branch information
dblodgett-usgs authored Aug 25, 2019
2 parents 6abaa64 + 54f8d7a commit 11e15ad
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 72 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: nhdplusTools
Type: Package
Title: Tools for Using NHDPlus Data
Title: NHDPlus Tools
Version: 0.3.7
Authors@R: person("David", "Blodgett", role = c("aut", "cre"), email = "[email protected]")
Description: Tools for traversing and working with National Hydrography Dataset Plus (NHDPlus) data. All methods implemented in 'nhdplusTools' are available in the NHDPlus documentation available from the US Environmental Protection Agency <https://www.epa.gov/waterdata/basic-information>.
Expand Down
11 changes: 6 additions & 5 deletions R/get_nhdplus.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ get_nhdplus_bybox <- function(box, layer) {
#' @importFrom utils download.file unzip
#' @export
#' @examples
#' download_nhdplushr("", c("01", "0203"), download_files = FALSE)
#' download_nhdplushr(tempdir(), c("01", "0203"), download_files = FALSE)
download_nhdplushr <- function(nhd_dir, hu_list, download_files = TRUE) {

nhdhr_bucket <- get("nhdhr_bucket", envir = nhdplusTools_env)
Expand Down Expand Up @@ -239,10 +239,11 @@ download_nhdplushr <- function(nhd_dir, hu_list, download_files = TRUE) {
#' @importFrom sf st_layers read_sf st_sf write_sf
#' @export
#' @examples
#' \dontrun{
#' # Not run because this will download a lot of data for the user.
#' download_dir <- download_nhdplushr("./", c("0302", "0303"))
#' get_nhdplushr(download_dir, "nhdplus_0302-03.gpkg")
#' \donttest{
#' # Note this will download a lot of data to a temp directory.
#' # Change 'tempdir()' to your directory of choice.
#' download_dir <- download_nhdplushr(tempdir(), c("0302", "0303"))
#' get_nhdplushr(download_dir, file.path(download_dir, "nhdplus_0302-03.gpkg"))
#' }
get_nhdplushr <- function(hr_dir, out_gpkg = NULL,
layers = c("NHDFlowline", "NHDPlusCatchment"),
Expand Down
2 changes: 1 addition & 1 deletion R/get_nldi.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ discover_nldi_navigation <- function(nldi_feature, tier = "prod") {
#' @export
#' @importFrom utils tail
#' @examples
#' \dontrun{ # Long running example
#' \donttest{
#' library(sf)
#' library(dplyr)
#'
Expand Down
7 changes: 7 additions & 0 deletions R/prep_nhdplus.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
#' @importFrom dplyr select filter left_join
#' @family refactor functions
#' @export
#' @examples
#' flines_in <- sf::read_sf(system.file("extdata/petapsco_flowlines.gpkg",
#' package = "nhdplusTools"))
#' prepare_nhdplus(flines_in,
#' min_network_size = 10,
#' min_path_length = 1,
#' warn = FALSE)
#'
prepare_nhdplus <- function(flines,
min_network_size,
Expand Down
4 changes: 2 additions & 2 deletions R/subset_nhdplus.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
#' @return path to the saved subset geopackage
#' @export
#' @examples
#' \dontrun{ # long running example
#' \donttest{
#' sample_data <- system.file("extdata/sample_natseamless.gpkg",
#' package = "nhdplusTools")
#'
#' nhdplus_path(sample_data)
#'
#' staged_nhdplus <- stage_national_data(output_path = "./")
#' staged_nhdplus <- stage_national_data(output_path = tempdir())
#'
#' sample_flines <- readRDS(staged_nhdplus$flowline)
#'
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nhdplusTools <img src="man/figures/logo.png" align="right" alt="" width="120" />

[![Build Status](https://travis-ci.org/USGS-R/nhdplusTools.svg?branch=master)](https://travis-ci.org/USGS-R/nhdplusTools) [![Coverage Status](https://coveralls.io/repos/github/USGS-R/nhdplusTools/badge.svg?branch=master)](https://coveralls.io/github/USGS-R/nhdplusTools?branch=master)
[![Build Status](https://travis-ci.org/USGS-R/nhdplusTools.svg?branch=master)](https://travis-ci.org/USGS-R/nhdplusTools) [![Coverage Status](https://coveralls.io/repos/github/USGS-R/nhdplusTools/badge.svg?branch=master)](https://coveralls.io/github/USGS-R/nhdplusTools?branch=master) [![CRAN Downloads](https://cranlogs.r-pkg.org/badges/grand-total/nhdplusTools)](https://cran.r-project.org/web/packages/nhdplusTools/index.html) [![CRAN](https://www.r-pkg.org/badges/version/nhdplusTools)](https://cran.r-project.org/web/packages/nhdplusTools/index.html)

## Tools for Manipulating the NHDPlus Network

Expand All @@ -11,6 +11,11 @@ but ongoing support is available due to use of the package in project work.

### Installation:

```
install.packages("nhdplusTools")
```

For the latest development:
```
install.packages("devtools")
devtools::install_github("USGS-R/nhdplusTools")
Expand Down
12 changes: 9 additions & 3 deletions docs/index.html

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

2 changes: 1 addition & 1 deletion docs/reference/download_nhdplushr.html

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

9 changes: 4 additions & 5 deletions docs/reference/get_nhdplushr.html

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

Binary file modified docs/reference/navigate_nldi-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 11e15ad

Please sign in to comment.