Skip to content

Commit

Permalink
Merge pull request #14 from mps9506/testing
Browse files Browse the repository at this point in the history
✅ Add appveyor
  • Loading branch information
mps9506 authored Mar 29, 2018
2 parents 0ddfc34 + 06f9a09 commit b5ebe23
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 27 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
^LICENSE\.md$
^\.travis\.yml$
^codecov\.yml$
^appveyor\.yml$
11 changes: 7 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ loadfonts()
# echor

[![Travis build status](https://travis-ci.org/mps9506/echor.svg?branch=master)](https://travis-ci.org/mps9506/echor)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/mps9506/echor?branch=master&svg=true)](https://ci.appveyor.com/project/mps9506/echor)
[![Coverage status](https://codecov.io/gh/mps9506/echor/branch/master/graph/badge.svg)](https://codecov.io/github/mps9506/echor?branch=master)

Coming soon ...

## Overview

The goal of echor is to download dishcarge and emission data from the EPA ECHO database in a tidy format.
echor downloads discharge and emission data for EPA permitted facilities using the [EPA ECHO API](https://echo.epa.gov/).

## Installation

Expand All @@ -39,6 +38,10 @@ devtools::install_github("mps9506/echor")
```

## Usage

Coming soon.

## Examples

### Download information about facilities with an NPDES permit
Expand Down Expand Up @@ -109,7 +112,7 @@ ggmap(collegestation) +
Use `echoGetEffluent()` or `echoGetCAAPR()` to download tidy dataframes of permitted water discharger Discharge Monitoring Report (DMR) or permitted emitters Clean Air Act annual emissions reports.

```{r}
df <- echoGetEffluent(p_id = 'tx0119407', parameter_code = '50050')
df <- echoGetEffluent(p_id = 'tx0119407', parameter_code = '00300')
df <- df %>%
filter(!is.na(DMRValueNmbr) & ValueTypeCode == "C1")
Expand Down
40 changes: 17 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
echor
=====

[![Travis build
status](https://travis-ci.org/mps9506/echor.svg?branch=master)](https://travis-ci.org/mps9506/echor)
[![Coverage
status](https://codecov.io/gh/mps9506/echor/branch/master/graph/badge.svg)](https://codecov.io/github/mps9506/echor?branch=master)

Coming soon …
[![Travis build status](https://travis-ci.org/mps9506/echor.svg?branch=master)](https://travis-ci.org/mps9506/echor) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/mps9506/echor?branch=master&svg=true)](https://ci.appveyor.com/project/mps9506/echor) [![Coverage status](https://codecov.io/gh/mps9506/echor/branch/master/graph/badge.svg)](https://codecov.io/github/mps9506/echor?branch=master)

Overview
--------

The goal of echor is to download dishcarge and emission data from the
EPA ECHO database in a tidy format.
echor downloads discharge and emission data for EPA permitted facilities using the [EPA ECHO API](https://echo.epa.gov/).

Installation
------------
Expand All @@ -23,15 +17,17 @@ Installation
devtools::install_github("mps9506/echor")
```

Usage
-----

Coming soon.

Examples
--------

### Download information about facilities with an NPDES permit

We can look up plants by permit id, bounding box, and numerous other
parameters. I plan on providing documentation of available parameters.
However, arguments can be looked up here:
[get\_cwa\_rest\_services\_get\_facility\_info](https://echo.epa.gov/tools/web-services/facility-search-water#!/Facility_Information/get_cwa_rest_services_get_facility_info)
We can look up plants by permit id, bounding box, and numerous other parameters. I plan on providing documentation of available parameters. However, arguments can be looked up here: [get\_cwa\_rest\_services\_get\_facility\_info](https://echo.epa.gov/tools/web-services/facility-search-water#!/Facility_Information/get_cwa_rest_services_get_facility_info)

``` r
library(tidyverse)
Expand All @@ -58,15 +54,15 @@ head(df)
#> # ... with 18 more variables: CWPZip <chr>,
#> # MasterExternalPermitNmbr <chr>, CWPCounty <chr>, CWPEPARegion <chr>,
#> # FacFederalAgencyCode <lgl>, FacLong <chr>,
#> # CWPFacilityTypeIndicator <chr>, BioReportingObligations2017 <lgl>,
#> # StormWaterArea <lgl>, SpeciesCriticalHabitalFlag <lgl>,
#> # SwpppUrl <lgl>, ExposedActivity <lgl>, AssociatedPollutant <lgl>,
#> # TypeOfMonitoring <lgl>, TypeOfWater <lgl>, EjscreenFlagUs <chr>,
#> # PctileProximityNPDESUs <chr>, PctileProximityNplUs <chr>
#> # CWPFacilityTypeIndicator <chr>, ReceivingMs4Name <lgl>,
#> # SpeciesCriticalHabitalFlag <lgl>, ExposedActivity <lgl>,
#> # AssociatedPollutant <lgl>, ControlMeasure <lgl>,
#> # ControlMeasureSchedule <lgl>, EjscreenFlagUs <chr>,
#> # Over80CountUs <chr>, PctilePctpre1960Us <chr>,
#> # PctileProximityRmpUs <chr>, PctileProximityTsdfUs <chr>
```

When returned as sf dataframes, the data is suitable for immediate
spatial plotting or analysis:
When returned as sf dataframes, the data is suitable for immediate spatial plotting or analysis:

``` r
library(ggmap)
Expand Down Expand Up @@ -114,12 +110,10 @@ ggmap(collegestation) +

### Download discharge/emissions data

Use `echoGetEffluent()` or `echoGetCAAPR()` to download tidy dataframes
of permitted water discharger Discharge Monitoring Report (DMR) or
permitted emitters Clean Air Act annual emissions reports.
Use `echoGetEffluent()` or `echoGetCAAPR()` to download tidy dataframes of permitted water discharger Discharge Monitoring Report (DMR) or permitted emitters Clean Air Act annual emissions reports.

``` r
df <- echoGetEffluent(p_id = 'tx0119407', parameter_code = '50050')
df <- echoGetEffluent(p_id = 'tx0119407', parameter_code = '00300')

df <- df %>%
filter(!is.na(DMRValueNmbr) & ValueTypeCode == "C1")
Expand Down
45 changes: 45 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# DO NOT CHANGE the "init" and "install" sections below

# Download script file from GitHub
init:
ps: |
$ErrorActionPreference = "Stop"
Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1"
Import-Module '..\appveyor-tool.ps1'
install:
ps: Bootstrap

cache:
- C:\RLibrary

# Adapt as necessary starting from here

build_script:
- travis-tool.sh install_deps

test_script:
- travis-tool.sh run_tests

on_failure:
- 7z a failure.zip *.Rcheck\*
- appveyor PushArtifact failure.zip

artifacts:
- path: '*.Rcheck\**\*.log'
name: Logs

- path: '*.Rcheck\**\*.out'
name: Logs

- path: '*.Rcheck\**\*.fail'
name: Logs

- path: '*.Rcheck\**\*.Rout'
name: Logs

- path: '\*_*.tar.gz'
name: Bits

- path: '\*_*.zip'
name: Bits
Binary file modified man/figures/README-example2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b5ebe23

Please sign in to comment.