---
title: "Introduction to nhdplusTools"
author: "dblodgett@usgs.gov"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Introduction to nhdplusTools}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include = FALSE}
library(nhdplusTools)
local <- (Sys.getenv("BUILD_VIGNETTES") == "TRUE")
if(local) {
  cache_path <- file.path(nhdplusTools_data_dir(), "nhdpt_v_cache")
} else {
  cache_path <- tempdir()
}

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width=6, 
  fig.height=4,
  eval=local,
  cache=local,
  cache.path=(cache_path)
)
```

The nhdplusTools package contains a wide range of hydrographic data utilities. Many are globally-applicable hydrographic data manipulation and processing tools. Others are specific to a U.S. context, focused on particular US datasets and sources.

Detailed documentation of all the package functions can be found at the **[Reference page](https://doi-usgs.github.io/nhdplusTools/reference/)**.

For data discovery and access in a U.S. context, start with the **US Data vignette** `vignette("US_data")`.

For globally applicable functions, start with the **advanced network attributes vignette** `vignette("advanced_network")`.

Please consider registering [issues and feature suggestions on github](https://github.com/dblodgett-usgs/nhdplusTools/issues).

**Installation**

For the latest CRAN release of nhdplusTools, use:
```{r cran, echo = TRUE, eval = FALSE}
# install.packages("nhdplusTools")
```

The easiest way to install the latest `nhdplusTools` development is with the `remotes` package like this:
```{r install, echo = TRUE, eval = FALSE}
# install.packages("remotes")
# remotes::install_github("doi-usgs/nhdplusTools")
```

The `nhdplusTools` package is intended to provide a reusable set of tools to
subset, relate data to, and rebuild attributes for hydrography data. 
It implements a data model consistent with both the [NHDPlus](https://www.epa.gov/waterdata/nhdplus-national-hydrography-dataset-plus)
and [HY\_Features](http://opengeospatial.github.io/HY_Features/). The package
aims to provide a set of tools with minimal dependencies that can be used
to build workflows using NHDPlus data-model data.

The package has three types of functionality presented in the following vignettes:

1. Data access in the U.S. context: `vignette("US_data")`
1. Indexing data to hydrography: `vignette("indexing")`
1. Hydrographic network attributes: `vignette("advanced_network")`

Two other vignette articles are available for the package.

1. Working with NHDPlusHR: `vignette("nhdplushr")`
1. Plotting NHDPlus data: `vignette("plot_nhdplus")`

Thanks for taking the time to read the package documentation. If you see anything that looks wrong or could be better, please consider opening an issue or a pull request in [github](https://github.com/dblodgett-usgs/nhdplusTools/issues)!

```{r teardown, include=FALSE}
if(Sys.getenv("BUILD_VIGNETTES") != "TRUE") {
  unlink(work_dir, recursive = TRUE)
}

```
