Type: | Package |
Title: | Access EPA 'ECHO' Data |
Version: | 0.1.9 |
Maintainer: | Michael Schramm <mpschramm@gmail.com> |
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/. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
Imports: | curl, dplyr, httr, plyr, progress, purrr, readr, rlang, sf, tibble, tidyr (≥ 1.0.0), utils |
Suggests: | httptest, testthat, utf8 |
BugReports: | https://github.com/mps9506/echor/issues |
URL: | https://github.com/mps9506/echor, https://mps9506.github.io/echor/ |
Language: | en-US |
Config/Needs/website: | mps9506/mpsTemplates, ggplot2, ggrepel, ggspatial, here, kableExtra, knitr, raster, rmarkdown, sf |
NeedsCompilation: | no |
Packaged: | 2023-06-20 23:27:50 UTC; michael.schramm |
Author: | Michael Schramm |
Repository: | CRAN |
Date/Publication: | 2023-06-22 17:20:02 UTC |
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 |
... |
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. |
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(xmin = '-96.407563',
ymin = '30.554395',
xmax = '-96.25947',
ymax = '30.751984',
output = 'df')
## Retrieve a simple features dataframe by bounding box
spatialdata <- echoAirGetFacilityInfo(xmin = '-96.407563',
ymin = '30.554395',
xmax = '-96.25947',
ymax = '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 |
output |
Character string specifying output format. |
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 |
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. |
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(xmin = '-96.407563',
ymin = '30.554395',
xmax = '-96.25947',
ymax = '30.751984',
p_pcomp = 'POW',
output = 'df')
## Retrieve a simple features dataframe by bounding box
spatialdata <- echoWaterGetFacilityInfo(xmin = '-96.407563',
ymin = '30.554395',
xmax = '-96.25947',
ymax = '30.751984',
p_pcomp = 'POW',
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")
Check responses
Description
Checks for valid server response and passes silently or produces a useful message.
Usage
resp_check(response)
Arguments
response |
response a [httr::GET()] request result returned from the API |
Value
nothing if check is passed, or an informative message if not passed.