readAttains | R Documentation |
This function pulls information from EPA ATTAINS database based on submitted arguments via ATTAINS web service. Any ATTAINS web service compatible argument can be submitted to this funciton. Depending on type, at least one argument may be required. See https://www.epa.gov/waterdata/how-access-and-use-attains-web-services for a list of required and compatible arguments. The function is essentially an ATTAINS specific wrapper for jsonlite::fromJSON. It generates the appropriate web path to connect to ATTAINS web service and converts JSON to R object.
readAttains(type = "assessments", stateCode = NULL, ...)
type |
ATTAINS data type to read. One of: "assessmentUnits", "assessments", or "actions". |
stateCode |
Two letter state code |
... |
Additional arguments to be passed to ATTAINS web service path. |
Returns a data.frame or list of queried ATTAINS data. Note that some results may contain additional lists of results that can be further flattened.
#Read Utah assessment unit information
UT_AUs=readAttains(type="assessmentUnits", stateCode="UT")
#Read Utah actions
UT_actions=readAttains(type="actions", stateCode="UT")
#Read Utah assessments
UT_assessments=readAttains(type="assessments", stateCode="UT", reportingCycle=2020)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.