An open API service indexing awesome lists of open source software.

https://github.com/jsta/nlar

R interface to the National Lakes Assessment
https://github.com/jsta/nlar

cran limnology rstats

Last synced: 5 months ago
JSON representation

R interface to the National Lakes Assessment

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "images/"
)
```

# nlaR

[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN status](http://www.r-pkg.org/badges/version/nlaR)](https://cran.r-project.org/package=nlaR)
[![R-CMD-check](https://github.com/jsta/nlaR/actions/workflows/check.yml/badge.svg)](https://github.com/jsta/nlaR/actions/workflows/check.yml)

The goal of nlaR is to provide an R interface to the National Lakes Assessment data. At this point it serves either the 2007 or 2012 data (see examples below).

## Installation

You can install nlaR from Github with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("jsta/nlaR")
```

## Usage

### Load package

```{r }
library(nlaR)
```

### Retrieve data from EPA Website

> Turn on automated data storage at the location returned by `rappdirs::user_data_dir()`

```{r eval=FALSE}
nla_get(2012, use_rappdirs = TRUE)
```

### Load data from local machine

```{r }
dt <- nla_load(2012)
```

### View NLA tables

```{r }
names(dt)
head(dt$phytocnt)
```

## More Examples

See [vignettes](https://jsta.github.io/nlaR/articles/).

## References

* [National Lakes Assessment EPA page](https://www.epa.gov/national-aquatic-resource-surveys/nla)

* Water quality metadata
* [2012](https://www.epa.gov/sites/production/files/2016-12/nla2012_waterchem_meta.txt)

* Stoddard, J.L., Van Sickle, J., Herlihy, A.T., Brahney, J., Paulsen, S., Peck, D.V., Mitchell, R. and Pollard, A.I., 2016. Continental-scale increase in lake and stream phosphorus: Are oligotrophic systems disappearing in the United States?. Environmental Science & Technology, 50(7), pp.3409-3415. [10.1021/acs.est.5b05950](https://doi.org/10.1021/acs.est.5b05950)