Package 'echor'

Title: Access EPA 'ECHO' Data
Description: An R interface to United States Environmental Protection Agency (EPA) Environmental Compliance History Online ('ECHO') Application Program Interface (API). 'ECHO' provides information about EPA permitted facilities, discharges, and other reporting info associated with permitted entities. Data are obtained from <https://echo.epa.gov/>.
Authors: Michael Schramm [aut, cre, cph]
Maintainer: Michael Schramm <[email protected]>
License: MIT + file LICENSE
Version: 0.1.9.9999
Built: 2024-09-12 06:07:29 UTC
Source: https://github.com/mps9506/echor

Help Index


Download Multiple DMRs

Description

Returns DMRs in a nested list using echoGetEffluent(). Uses a dataframe with a column of p_id numbers. Please note that p_id's are case sensitive.

Usage

downloadDMRs(df, idColumn, pBar = TRUE, verbose = FALSE, ...)

Arguments

df

dataframe with column of id numbers

idColumn

unquoted string, name of column containing the p_id permit numbers

pBar

logical, display a progress bar? Defaults to TRUE

verbose

logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE. Suggest leaving this FALSE if pBar = TRUE.

...

additional arguments passed to echoGetEffluent

Value

dataframe df, with a column containing the discharge monitoring reports downloaded with echoGetEffluentSummary

Examples

## This example requires an internet connection to run

## Retrieve multiple DMRs for flow

df <- tibble::tibble("id" = c('TX0119407', 'TX0132187'))
df <- downloadDMRs(df, id)

Downloads EPA ECHO permitted air emitter information

Description

Returns a dataframe or simplefeature dataframe of permitted facilities returned by the query. Uses EPA's ECHO API: https://echo.epa.gov/tools/web-services/facility-search-air#!/Facilities/get_air_rest_services_get_facility_info

Usage

echoAirGetFacilityInfo(output = "df", verbose = FALSE, ...)

Arguments

output

Character string specifying output format. output = 'df' for a dataframe or output = 'sf' for a simple features spatial dataframe. See (https://CRAN.R-project.org/package=sf) for more information about simple features.

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

...

Further arguments passed as query parameters in request sent to EPA ECHO's API. For more options see: https://echo.epa.gov/tools/web-services/facility-search-water#!/Facility_Information/get_air_rest_services_get_facility_info for a complete list of parameter options. Examples provided below.

Value

dataframe or sf dataframe suitable for plotting

Examples

## These examples require an internet connection to run

## Retrieve table of facilities by bounding box
echoAirGetFacilityInfo(p_c1lon = '-96.407563',
p_c1lat = '30.554395',
p_c2lon = '-96.25947',
p_c2lat = '30.751984',
output = 'df')

## Retrieve a simple features dataframe by bounding box
spatialdata <- echoAirGetFacilityInfo(p_c1lon = '-96.407563',
p_c1lat = '30.554395',
p_c2lon = '-96.25947',
p_c2lat = '30.751984',
output = 'sf')

Downloads EPA ECHO Air Facility Metadata

Description

Returns variable name and descriptions for parameters returned by echoAirGetFacilityInfo

Usage

echoAirGetMeta(verbose = FALSE)

Arguments

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

Value

returns a dataframe

Examples

## These examples require an internet connection to run

# returns a dataframe of
echoAirGetMeta()

Download EPA ECHO emissions inventory report data

Description

Download EPA ECHO emissions inventory report data

Usage

echoGetCAAPR(p_id, verbose = FALSE, ...)

Arguments

p_id

character string specify the identifier for the service. Required.

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

...

Additional arguments

Value

dataframe

Examples

## This example requires an internet connection to run

echoGetCAAPR(p_id = '110000350174')

Downloads EPA ECHO DMR records of dischargers with NPDES permits

Description

Uses EPA ECHO API to download the Discharge Monitoring Record (DMR) of a single plant, identified with p_id. Please note that the p_id is case sensitive.

Usage

echoGetEffluent(p_id, verbose = FALSE, ...)

Arguments

p_id

Character string specify the identifier for the service. Required. Case sensitive.

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

...

Further arguments passed on as query parameters sent to EPA's ECHO API. For more options see: https://echo.epa.gov/tools/web-services/effluent-charts#!/Effluent_Charts/get_eff_rest_services_get_effluent_chart

Value

Returns a dataframe.

Examples

## This example requires an internet connection to run

## Retrieve single DMR for flow

echoGetEffluent(p_id = 'tx0119407', parameter_code = '50050')

Downloads permitted facility information

Description

Provides interface for downloading facility information from Clean Air Act, Clean Water Act, and Safe Drinking Water Act permitted facilities.

Usage

echoGetFacilities(program, output = "df", verbose = FALSE, ...)

Arguments

program

Character, either program = 'caa', program = 'cwa', or program = 'sdw'. 'caa' retrieves facilities permitted under the Clean Air Act, 'cwa' retrieves facilities permitted under the Clean Water Act, and 'sdw' retrieves facilities permitted under the the Safe Drinking Water Act.

output

Character string specifying output format. output = 'df' for a dataframe or output = 'sf' for a simple features spatial dataframe. 'sf' only applies to CAA and CWA queries.

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE.

...

Further arguments passed as query parameters in request sent to EPA ECHO's API.

Value

dataframe or sf dataframe suitable for plotting


Downloads self reported discharge and emissions data

Description

Downloads self reported discharge and emissions data

Usage

echoGetReports(program, p_id, verbose = FALSE, ...)

Arguments

program

Character, either program = 'caa' or program = 'cwa'. 'caa' retrieves facilities permitted under the Clean Air Act, 'cwa' retrieves facilities permitted under the Clean Water Act.

p_id

Character string specify the identifier for the service. Required.

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE.

...

Further arguments passed on as query parameters sent to EPA's ECHO API.

Value

Returns a dataframe


Downloads EPA ECHO Safe Drinking Water Facilities Metadata

Description

Downloads EPA ECHO Safe Drinking Water Facilities Metadata

Usage

echoSDWGetMeta(verbose = FALSE)

Arguments

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

Value

returns a dataframe

Examples

## These examples require an internet connection to run

# returns a dataframe of
echoSDWGetMeta()

Downloads public water system information

Description

Returns a dataframe of permitted public water systems returned by the query. Uses EPA's ECHO API: https://echo.epa.gov/tools/web-services/facility-search-drinking-water#!/Safe_Drinking_Water/get_sdw_rest_services_get_systems.

Usage

echoSDWGetSystems(verbose = FALSE, ...)

Arguments

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

...

Further arguments passed as query parameters in request sent to EPA ECHO's API. For more options see: https://echo.epa.gov/tools/web-services/facility-search-drinking-water#!/Safe_Drinking_Water/get_sdw_rest_services_get_systems for a complete list of parameter options. Examples provided below.

Value

returns a dataframe

Examples

## These examples require an internet connection to run
echoSDWGetSystems(p_co = "Brazos", p_st = "tx")

Downloads EPA ECHO water facility information

Description

Returns a dataframe or simplefeature dataframe of permitted facilities returned by the query. Uses EPA's ECHO API: https://echo.epa.gov/tools/web-services/facility-search-water.

Usage

echoWaterGetFacilityInfo(output = "df", verbose = FALSE, ...)

Arguments

output

Character string specifying output format. output = 'df' for a dataframe or output = 'sf' for a simple features spatial dataframe. See (https://CRAN.R-project.org/package=sf) for more information about simple features.

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

...

Further arguments passed as query parameters in request sent to EPA ECHO's API. For more options see: https://echo.epa.gov/tools/web-services/facility-search-water#!/Facility_Information/get_cwa_rest_services_get_facility_info for a complete list of parameter options. Examples provided below.

Value

returns a dataframe or simple features dataframe

Examples

## These examples require an internet connection to run

## Retrieve table of facilities by bounding box
echoWaterGetFacilityInfo(p_c1lon = '-96.407563',
p_c1lat = '30.554395',
p_c2lon = '-96.25947',
p_c2lat = '30.751984',
p_pcomp = 'POT',
output = 'df')

## Retrieve a simple features dataframe by bounding box
spatialdata <- echoWaterGetFacilityInfo(p_c2lon = '-96.407563',
p_c1lat = '30.554395',
p_c2lon = '-96.25947',
p_c2lat = '30.751984',
p_pcomp = 'POT',
output = 'sf')

Downloads EPA ECHO Water Facility Metadata

Description

Returns variable name and descriptions for parameters returned by echoWaterGetFacilityInfo

Usage

echoWaterGetMeta(verbose = FALSE)

Arguments

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

Value

returns a dataframe

Examples

## These examples require an internet connection to run

# returns a dataframe of
echoWaterGetMeta()

Search parameter codes for Clean Water Act permits on EPA ECHO

Description

Returns a dataframe of parameter codes and descriptions.

Usage

echoWaterGetParams(term = NULL, code = NULL, verbose = FALSE)

Arguments

term

Character string specifying the parameter search term. Partial or complete search phrase or word.

code

Character string specifying the parameter search code value.

verbose

Logical, indicating whether to provide processing and retrieval messages. Defaults to FALSE

Value

Returns a dataframe.

Examples

## These examples require an internet connection to run

## Retrieve parameter codes for dissolved oxygen
echoWaterGetParams(term = "Oxygen, dissolved")

echoWaterGetParams(code = "00300")