aqs_qaannualperformanceevaluations {raqs} | R Documentation |
AQS API QA Annual Performance Evaluations service
Description
A collection of functions to fetch pairs of data (known and measured values) at several concentration levels for gaseous criteria pollutants.
Usage
aqs_qaannualperformanceevaluations(
aqs_filter = c("bySite", "byCounty", "byState", "byPQAO", "byMA"),
aqs_variables = NULL,
header = FALSE,
...
)
qaannualperformanceevaluations_bysite(
param,
bdate,
edate,
state,
county,
site,
email = get_aqs_email(),
key = get_aqs_key(),
header = FALSE,
...
)
qaannualperformanceevaluations_bycounty(
param,
bdate,
edate,
state,
county,
email = get_aqs_email(),
key = get_aqs_key(),
header = FALSE,
...
)
qaannualperformanceevaluations_bystate(
param,
bdate,
edate,
state,
email = get_aqs_email(),
key = get_aqs_key(),
header = FALSE,
...
)
qaannualperformanceevaluations_bypqao(
param,
bdate,
edate,
pqao,
email = get_aqs_email(),
key = get_aqs_key(),
header = FALSE,
...
)
qaannualperformanceevaluations_byma(
param,
bdate,
edate,
agency,
email = get_aqs_email(),
key = get_aqs_key(),
header = FALSE,
...
)
Arguments
aqs_filter |
A string specifying one of the service filters. NOT case-sensitive. |
aqs_variables |
A named list of variables to fetch data (e.g.,
|
header |
A logical specifying whether the function returns additional
information from the API header. Default is |
... |
Reserved for future use. |
param |
A string or vector of strings specifying the 5-digit AQS parameter code for data selection. An integer will be coerced to a string. A maximum of 5 parameter codes may be listed in a single request. A list of the parameter codes can be obtained via list_parametersbyclass. |
bdate |
A string specifying the begin date of data selection in YYYYMMDD format. Only data on or after this date will be returned. |
edate |
A string specifying the end date of data selection in YYYYMMDD format. Only data on or before this date will be returned. If the end date is not in the same year as the begin date, the function will automatically split the date range into multiple chunks by year and send requests sequentially. |
state |
A string specifying the 2-digit state FIPS code. An integer will be coerced to a string with a leading zero if necessary (e.g., 1 -> "01"). A list of the state codes can be obtained via list_states. |
county |
A string specifying the 3-digit county FIPS code. An integer will be coerced to a string with leading zeros if necessary (e.g., 89 -> "089"). A list of the county codes within each state can be obtained via list_countiesbystate. |
site |
A string specifying the 4-digit AQS site number within the county. An integer will be coerced to a string with leading zeros if necessary (e.g., 14 -> "0014"). A list of the site codes within each county can be obtained via list_sitesbycounty. |
email |
A string specifying the email address of the requester. If you set your email and key with set_aqs_user, you don't have to specify this. |
key |
A string specifying the key matching the email address for the requester. If you set your email and key with set_aqs_user, you don't have to specify this. |
pqao |
A string specifying the AQS Primary Quality Assurance Organization (PQAO) code. A list of the PQAO codes can be obtained via list_pqaos. |
agency |
A string specifying the AQS Monitoring Agency (MA) code. A
list of the MA codes can be obtained via list_mas. Here, we named this
input as |
Details
aqs_qaannualperformanceevaluations sends a request to the AQS API based on a user-provided filter using the following underlying functions:
-
qaannualperformanceevaluations_bysite returns annual performance evaluation data for
param
atsite
incounty
, withinstate
, betweenbdate
andedate
. -
qaannualperformanceevaluations_bycounty returns annual performance evaluation data for
param
incounty
withinstate
betweenbdate
andedate
. -
qaannualperformanceevaluations_bystate returns annual performance evaluation data for
param
instate
betweenbdate
andedate
. -
qaannualperformanceevaluations_bypqao returns annual performance evaluation data for
param
inpqao
betweenbdate
andedate
. -
qaannualperformanceevaluations_byma returns annual performance evaluation data for
param
inagency
(monitoring agency) betweenbdate
andedate
.
Value
A data.frame containing parsed data or a named list containing header and data.
Examples
## Not run:
## Set your API Key first using set_aqs_user to run the following codes
## Example from the AQS website
## Annual performance evaluation data for ozone in Alabama during 2017
aqs_variables <- list(
param = "44201", bdate = "20170101", edate = "20171231",
state = "01"
)
aqs_qaannualperformanceevaluations(
aqs_filter = "byState", aqs_variables = aqs_variables
)
## Equivalent to above; used integers instead of strings
qaannualperformanceevaluations_bystate(
param = 44201, bdate = "20170101", edate = "20171231",
state = 1
)
## End(Not run)