Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jsta/nesr

Scrape Data from the National Eutrophication Survey
https://github.com/jsta/nesr

epa rstats water-quality

Last synced: about 2 months ago
JSON representation

Scrape Data from the National Eutrophication Survey

Awesome Lists containing this project

README

        

---
output: github_document
bibliography:
- inst/references.bib
nocite: |
@brett_review_2007, @reckhow_empirical_1988, @StachelekNationalEutrophicationSurvey2017
csl: inst/ecology.csl
---

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

```{r knitcitations, echo=FALSE, cache = FALSE}
library(knitcitations)
cleanbib()
cite_options(citation_format = "pandoc")
```

# nesR

Code to rescue (scrape) data from the National Eutrophication Survey archival PDF.

## Installation

### Prerequites

Until `magick` can handle local adaptive thresholding. This package requires you to be able to call the `imagemagick` `convert` command with `system()`.

You can install nesR from github with:

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

## Usage

### Load package

```{r }
library(nesR)
```

### Get data

```{r eval=TRUE}
nes_file <- system.file("extdata/national-eutrophication-survey_477.PDF",
package = "nesR")
res <- nes_get(nes_file, 89)
parse_nes(res)
```

### Build database

As written, building the NES database requires GNU Make and the ability to run `R` commands using the `Rscript` command-line utility (aka doesn't work on Windows). For best results, use a machine with at least 4 GB RAM.

```{bash eval=FALSE}
make PDFSOURCE=474 all
make PDFSOURCE=475 all
make PDFSOURCE=476 all
make PDFSOURCE=477 all
```

# References

```{r write_citations, cache=FALSE, include=FALSE,eval=FALSE}
write.bibtex(file="inst/references.bib")
```