Package 'RAQSAPI'

Title: A Simple Interface to the US EPA Air Quality System Data Mart API
Description: Retrieve air monitoring data and associated metadata from the US Environmental Protection Agency's Air Quality System service using functions. See <https://aqs.epa.gov/aqsweb/documents/data_api.html> for details about the US EPA Data Mart API.
Authors: Clinton Mccrowey [cre, aut] (United States Environmental Protection Agency Region 3 Air and Radiation Division), Timothy Sharac [ctb, rev] (United States Environmental Protection Agency), Nick Mangus [rev] (United States Environmental Protection Agency), Doug Jager [ctb, rev] (United States Environmental Protection Agency), Ryan Brown [ctb, rev] (United States Environmental Protection Agency), Daniel Garver [ctb, rev] (United States Environmental Protection Agency), Benjamin Wells [ctb, rev] (United States Environmental Protection Agency), Hayley Brittingham [crr, ctr] (Neptune and Company), Jeffrey Hollister [rev] (United States Environmental Protection Agency, <https://orcid.org/0000-0002-9254-9740>), Edward Andrews [rev, ctb] (West Virginia Department of Environmental Protection, Division of Air Quality)
Maintainer: Clinton Mccrowey <[email protected]>
License: MIT + file LICENSE
Version: 2.0.5
Built: 2024-11-09 04:38:58 UTC
Source: https://github.com/usepa/raqsapi

Help Index


aqs_annualsummary_by_box

Description

[Stable] Returns multiple years of data where annual data is aggregated at the bounding box level. Returned is an annual summary within the input parameter, latitude/longitude bounding box provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc. If return_header is FALSE (default) the object returned is a tibble, if TRUE an AQS_API_v2 object.

Usage

aqs_annualsummary_by_box(
  parameter,
  bdate,
  edate,
  minlat,
  maxlat,
  minlon,
  maxlon,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

minlat

a R character object which represents the minimum latitude of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.

maxlat

a R character object which represents the maximum latitude of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.

minlon

a R character object which represents the minimum longitude of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.

maxlon

a R character object which represents the maximum longitude of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that containing annual summary data for the box (area) requested. A AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of annualsummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_box functions: aqs_monitors_by_box(), aqs_sampledata_by_box()

Examples

# Returns a tibble containing ozone annual summaries
          #  in the vicinity of central Alabama for the first two days
          # of May, 2015
          ## Not run: aqs_annualsummary_by_box(parameter = "44201",
                                            bdate = as.Date("20150501",
                                                          format = "%Y%m%d"),
                                            edate = as.Date("20170502",
                                                          format = "%Y%m%d"),
                                            minlat = "33.3",
                                            maxlat = "33.6",
                                            minlon = "-87.0",
                                            maxlon = "-86.7"
                                            )
                   
## End(Not run)

aqs_annualsummary_by_cbsa

Description

[Stable] Returns multiple years of data where annual data is aggregated at the Core Based Statistical Area (CBSA) level. Returned is an annual summary matching the input parameter, and cbsa_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc. If return_header is FALSE (default) the object returned is a tibble, if TRUE an AQS_API_v2 object.

Usage

aqs_annualsummary_by_cbsa(
  parameter,
  bdate,
  edate,
  cbsa_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

cbsa_code

a R character object which represents the 5 digit AQS Core Based Statistical Area code (the same as the census code, with leading zeros)

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that containing annual summary data for the cbsa_code requested. A AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of annualsummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_cbsa functions: aqs_dailysummary_by_cbsa(), aqs_monitors_by_cbsa(), aqs_sampledata_by_cbsa()

Examples

# Returns a tibble of annual summary $NO_{2}$
          #  data the for Charlotte-Concord-Gastonia, NC cbsa on
          #  Janurary 01, 2017
          ## Not run: aqs_annualsummary_by_cbsa(parameter = "42602",
                                             bdate = as.Date("20170101",
                                                            format = "%Y%m%d"
                                                            ),
                                             edate = as.Date("20170101",
                                                            format = "%Y%m%d"
                                                            ),
                                             cbsa_code = "16740"
                                             )
                   
## End(Not run)

aqs_annualsummary_by_county

Description

[Stable] Returns multiple years of data where annual data is aggregated at the county level. Returned is an annual summary matching the input parameter, stateFIPS, and county_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc. If return_header is FALSE (default) the object returned is a tibble, if TRUE an AQS_API_v2 object.

Usage

aqs_annualsummary_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that containing annual summary data for the countycode and stateFIPS requested. A AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of annualsummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns an aqs S3 object with annual summary FRM/FEM
          #  PM2.5 data for Wake County, NC between January
          #  and February 2016
 ## Not run: aqs_annualsummary_by_county(parameter = "88101",
                                      bdate = as.Date("20160101",
                                                      format = "%Y%m%d"),
                                       edate = as.Date("20180228",
                                                      format = "%Y%m%d"),
                                       stateFIPS = "37",
                                       countycode = "183"
                                       )
         
## End(Not run)

aqs_annualsummary_by_site

Description

[Stable] Returns multiple years of data where annual data is aggregated at the site level. Returned is an annual summary matching the input parameter, stateFIPS, county_code, and sitenum provided for bdate - edate time frame. The data returned is summarized at the annual level. Variables returned include mean value, maxima, percentiles, and etc. If return_header is FALSE (default) the object returned is a tibble, if TRUE an AQS_API_v2 object.

Usage

aqs_annualsummary_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested as a single tibble. If TRUE returns a list of AQSAPI_v2 objects which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing annual summary data for the sitenum, countycode and stateFIPS requested. A AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of annualsummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

# Returns a tibble of annual summary ozone
          #  data for the Millbrook School site (\#0014) in Wake County,
          #  NC for 2017 (Note, for annual data, only the
          #  year portion of the bdate and edate are used and only whole
          #  years of data are returned. For example, bdate = 2017-12-31 and
          #  edate = 2018-01-01 will return full data for 2017 and 2018 )
 ## Not run: 
          aqs_annualsummary_by_site(parameter = "44201",
                                    bdate = as.Date("20170618",
                                                    format="%Y%m%d"),
                                    edate = as.Date("20190618",
                                                    format="%Y%m%d"),
                                    stateFIPS = "37",
                                    countycode = "183",
                                    sitenum = "0014"
                                   )
          
## End(Not run)

aqs_annualsummary_by_state

Description

[Stable] Returns multiple years of data where annual data is aggregated at the state level. Returned is an annual summary matching the input parameter and stateFIPS provided for bdate - edate time frame. The data returned is summarized at the annual level. Variables returned include mean value, maxima, percentiles, and etc. If return_header is FALSE (default) the object returned is a tibble, if TRUE an AQS_API_v2 object.

Usage

aqs_annualsummary_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that containing annual summary data for the stateFIPS requested. A AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data is a tibble of the data returned.

Note

The AQS API only allows for a single year of annualsummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble of all benzene annualy
          #  summaries from North Carolina collected for 1995
          ## Not run: aqs_annualsummary_by_state(parameter = "45201",
                                              bdate = as.Date("19950515",
                                                              format="%Y%m%d"
                                                              ),
                                              edate = as.Date("19950515",
                                                            format = "%Y%m%d"
                                                             ),
                                              stateFIPS = "37"
                                              )
                   
## End(Not run)

aqs_cbsas

Description

[Stable] Returns a table of all Core Based Statistical Areas (cbsa) and their associated cbsa_codes. for constructing other requests.

Usage

aqs_cbsas(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of all Core Based Statistical Areas (cbsa) and their cbsa_codes for constructing other requests.

Examples

# Returns a tibble of Core Based Statistical Areas (cbsas)
          # and their respective cbsa codes
          ## Not run:  aqs_cbsas()

aqs_classes

Description

[Stable] Returns a table of Parameter classes (groups of parameters, i.e. "criteria" or "all"). The information from this function can be used as input to other API calls.

Usage

aqs_classes(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of Parameter classes (groups of parameters, i.e. "criteria" or "all").

Examples

# Returns a tibble of parameter classes (groups of parameters, i.e.
          # "criteria" or all")
         ## Not run:  aqs_classes()

aqs_counties_by_state

Description

[Stable] Returns a table of all counties in within the stateFIPS provided.

Usage

aqs_counties_by_state(stateFIPS, return_header = FALSE)

Arguments

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zeros) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of all counties in the requested state.

Examples

# Returns a tibble all the counties
          #   in North Carolina the county FIPS codes (county codes) for
          #   each.
          ## Not run: aqs_counties_by_state(stateFIPS = "37")

aqs_credentials

Description

[Stable] Sets the user credentials for the AQS API. This function needs to be called once and only once every time this library is re-loaded. Users must have a valid username and key which can be obtained through the use of the aqs_sign_up function, @seealso aqs_sign_up() to sign up for AQS data mart credentials.

Usage

aqs_credentials(username = NA_character_, key = NA_character_)

Arguments

username

a R character object which represents the email account that will be used to connect to the AQS API.

key

the key used in conjunction with the username given to connect to AQS Data Mart.

Value

None

RAQSAPI setup functions

NA

Examples

#to authenticate an existing user the email address
 # "[email protected]" and key = "MyKey"
 #  after calling this function please follow the instructions that are sent
 #  in the verification e-mail before proceeding.
 ## Not run: aqs_credentials(username = "[email protected]",
                              key = "MyKey")
         
## End(Not run)

aqs_dailysummary_by_box

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object containing daily summary data bounded within a latitude/longitude bounding box

Usage

aqs_dailysummary_by_box(
  parameter,
  bdate,
  edate,
  minlat,
  maxlat,
  minlon,
  maxlon,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

minlat

a R character object which represents the minimum latitude of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.

maxlat

a R character object which represents the maximum latitude of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.

minlon

a R character object which represents the minimum longitude of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.

maxlon

a R character object which represents the maximum longitude of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object that contains daily summary statistics for the given parameter for an area bounded within a latitude/longitude bounding box. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of dailysummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

Examples

#Returns a tibble of ozone daily summaries in the vicinity of
          #  central Alabama for the first two days of May 2015

          ## Not run: aqs_dailysummary_by_box(parameter = "44201",
                                           bdate = as.Date("20140501",
                                                           format = "%Y%m%d"
                                                          ),
                                            edate = as.Date("20160502",
                                                            format = "%Y%m%d"
                                                            ),
                                            mqinlat ="33.3",
                                            maxlat = "33.6",
                                            minlon = "-87.0",
                                            maxlon = "-86.7"
                                            )
                   
## End(Not run)

aqs_dailysummary_by_cbsa

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object containing daily summary data aggregated by cbsa (Core Based Statistical Area) code.

Usage

aqs_dailysummary_by_cbsa(
  parameter,
  bdate,
  edate,
  cbsa_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

cbsa_code

a R character object which represents the 5 digit AQS Core Based Statistical Area code (the same as the census code, with leading zeros)

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains daily summary statistics for the given parameter for a single cbsa_code. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of dailysummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_cbsa functions: aqs_annualsummary_by_cbsa(), aqs_monitors_by_cbsa(), aqs_sampledata_by_cbsa()

Examples

# Returns a tibble of $NO_{2}$ daily summary
          #  data the for Charlotte-Concord-Gastonia, NC cbsa on
          #  Janurary 01, 2017
          ## Not run: aqs_dailysummary_by_cbsa(parameter = "42602",
                                               bdate = as.Date("20170101",
                                                            format = "%Y%m%d"
                                                              ),
                                               edate = as.Date("20190101",
                                                            format = "%Y%m%d"
                                                              ),
                                               cbsa_code = "16740"
                                           )
                   
## End(Not run)

aqs_dailysummary_by_county

Description

[Stable] Returns multiple years of data where daily data is aggregated at the site level. Returned is a daily summary matching the input parameter, stateFIPS and county_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.

Usage

aqs_dailysummary_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains daily summary statistics for the given parameter for a single countycode and stateFIPS combination. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of dailysummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns an aqs S3 object of daily summary FRM/FEM PM2.5 data
          #  for Wake County, NC between January and February 2016
 ## Not run: aqs_dailysummary_by_county(parameter = "88101",
                                     bdate = as.Date("20160101",
                                                   format = "%Y%m%d"),
                                     edate = as.Date("20170228",
                                                     format = "%Y%m%d"),
                                     stateFIPS = "37",
                                     countycode = "183"
                                    )
         
## End(Not run)

aqs_dailysummary_by_site

Description

[Stable] Returns multiple years of data where dailysummary data is aggregated at the site level. Returned is a daily summary matching the input parameter stateFIPS, countycode, and sitenum provided for bdate - edate time frame. Data is aggregated at the state level. Variables returned include mean value, maxima, percentiles, and etc.

Usage

aqs_dailysummary_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains daily summary statistics for the given parameter for a single site. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of dailysummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

#Returns a tibble of daily summary ozone
          #  data for the Millbrook School site (\#0014) in Wake County,
          #  NC for June 18, 2017.
 ## Not run: 
             aqs_dailysummary_by_site(parameter = "44201",
                                      bdate = as.Date("20160618",
                                                      format = "%Y%m%d"),
                                      edate = as.Date("20190618",
                                                      format = "%Y%m%d"),
                                      stateFIPS = "37",
                                      countycode = "183",
                                     sitenum = "0014"
                                     )
         
## End(Not run)

aqs_dailysummary_by_state

Description

[Stable] Returns multiple years of data where daily data is aggregated at the state level. Returned is a daily summary matching the input parameter and stateFIPS provided for bdate - edate time frame. Data is aggregated at the state level. Variables returned include mean value, maxima, percentiles, and etc.

Usage

aqs_dailysummary_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains daily summary statistics for the given parameter for a single stateFIPS. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of dailysummary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble of all benzene daily
          #  summaries from North Carolina collected on May 15th, 1995
          ## Not run: aqs_dailysummary_by_state(parameter = "45201",
                                             bdate = as.Date("19950515",
                                                             format="%Y%m%d"
                                                             ),
                                             edate = as.Date("19970515",
                                                            format = "%Y%m%d"
                                                             ),
                                             stateFIPS = "37"
                                             )
                   
## End(Not run)

aqs_fieldsbyservice

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object with the list and definitions of fields in the service requested.

Usage

aqs_fields_by_service(service, return_header = FALSE)

Arguments

service

a string which represents the services provided by the AQS API. For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object with containing the list and definitions of fields requested service

Examples

# Returns a tibble containing a list and definitions
          #  of fields in the Sample Data service
         ## Not run: aqs_fieldsbyservice(service = "sampleData")

aqs_isavailable

Description

[Stable] returns a tibble that details the status of the AQS Data Mart API.

Usage

aqs_isavailable()

Value

a tibble that details the status of the AQS Data Mart API.

list functions

NA

Examples

# Check if the AQS API is up, running and accepting requests.
  ## Not run:  aqs_isAvailable()

aqs_knownissues

Description

[Stable] Returns a table of any known issues with system functionality or the data. These are usually issues that have been identified internally and will require some time to correct in Data Mart or the API. This function implements a direct API call to Data Mart and returns data directly from the API. Issues returned via this function do not include any issues from the RAQSAPI R package.

Usage

aqs_knownissues(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains information involving known issues with the Data Mart API.

Examples

# Retrieve a tibble of known issues directly from the AQS data mart API
       ## Not run: aqs_knownissues()

aqs_mas

Description

[Stable] Returns a table of monitoring agencies (MA).

Usage

aqs_mas(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of monitoring agencies and their associated agency code.

Examples

# Returns a tibble or an AQS_Data Mart_APIv2 S3 object
          # of monitoring agencies and their respective
          # monitoring agency codes.
          ## Not run: aqs_mas()

aqs_metadata_service

Description

A helper function for functions which use the metaData service from the AQS API. This function is not intended to be called directly by the end user

Usage

aqs_metadata_service(
  filter,
  service = NA_character_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

filter

a character string representing the filter being applied

service

a character string representing the service

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.


aqs_monitors_by_box

Description

[Stable] Returns a table of monitors and related metadata sites with the provided parameter, aggregated by latitude/longitude bounding box (_by_box) for bdate - edate time frame.

Usage

aqs_monitors_by_box(
  parameter,
  bdate,
  edate,
  minlat,
  maxlat,
  minlon,
  maxlon,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

minlat

a R character object which represents the minimum latitude of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.

maxlat

a R character object which represents the maximum latitude of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.

minlon

a R character object which represents the minimum longitude of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.

maxlon

a R character object which represents the maximum longitude of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of monitors from a latitude/longitude bounding box (_by_box).

by_box aggregate functions

NA

Note

All monitors that operated between the bdate and edate will be returned

See Also

Other Aggregate _by_box functions: aqs_annualsummary_by_box(), aqs_sampledata_by_box()

Examples

#  Returns a tibble of all ozone
          #  monitors in the vicinity of central Alabama that operated in
          #  1995
          ## Not run: aqs_monitors_by_box(parameter="44201",
                                       bdate=as.Date("19950101",
                                                     format="%Y%m%d"),
                                       edate=as.Date("19951231",
                                                     format="%Y%m%d"),
                                       minlat="33.3",
                                       maxlat="33.6",
                                       minlon="-87.0",
                                       maxlon="-86.7"
                                       )
                   
## End(Not run)

aqs_monitors_by_cbsa

Description

[Stable] Returns a table of monitors at all sites with the provided parameter, aggregated by Core Based Statistical Area (CBSA) for bdate - edate time frame.

Usage

aqs_monitors_by_cbsa(
  parameter,
  bdate,
  edate,
  cbsa_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

cbsa_code

a R character object which represents the 5 digit AQS Core Based Statistical Area code (the same as the census code, with leading zeros)

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that is the return value from the AQS API. A AQS_Data Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

by_cbsa (By Core Based Statistical Area, as defined by the US Census Bureau) aggregate functions

NA

Note

All monitors that operated between the bdate and edate will be returned

See Also

Other Aggregate _by_cbsa functions: aqs_annualsummary_by_cbsa(), aqs_dailysummary_by_cbsa(), aqs_sampledata_by_cbsa()

Examples

# returns a tibble of $NO_{2}$ monitors
          #  for Charlotte-Concord-Gastonia, NC cbsa that were operating
          #  on Janurary 01, 2017
          ## Not run: aqs_monitors_by_cbsa(parameter="42602",
                                               bdate=as.Date("20170101",
                                                           format="%Y%m%d"),
                                               edate=as.Date("20170101",
                                                            format="%Y%m%d"),
                                               cbsa_code="16740"
                                                   )
                   
## End(Not run)

aqs_monitors_by_county

Description

[Stable] Returns a table of monitors and related metadata at sites with the provided parameter, stateFIPS and county_code for bdate - edate time frame.

Usage

aqs_monitors_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of monitors from a selected county

by_county aggregate functions

NA

Note

All monitors that operated between the bdate and edate will be returned

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns an aqs_v2 S3 object containing all SO2 monitors in
          #  Hawaii County, HI that were operating between May 01-02, 2015.
 ## Not run: aqs_monitors_by_county(parameter="42401",
                                 bdate=as.Date("20150501", format="%Y%m%d"),
                                 edate=as.Date("20150502", format="%Y%m%d"),
                                 stateFIPS="15",
                                 countycode="001"
                                 )
         
## End(Not run)

aqs_monitors_by_site

Description

[Stable] Returns a table of monitors and related metadata at sites with the provided parameter, stateFIPS, county_code, and sitenum for bdate - edate time frame.

Usage

aqs_monitors_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of monitors from a selected stateFIPS, county, and sitenum combination.

by_site aggregate functions

NA

Note

All monitors that operated between the bdate and edate will be returned

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

#Returns a tibble of the SO2 monitors at Hawaii
 #  Volcanoes NP site (\#0007) in Hawaii County, HI that were operating
 # between May 1 , 2015-2019. (Note, all monitors that operated between the
 # bdate and edate will be returned).
 ## Not run: 
           aqs_monitors_by_site(parameter = "42401",
                                  bdate = as.Date("20150501",
                                                     format="%Y%m%d"),
                                  edate = as.Date("20190501",
                                                     format="%Y%m%d"),
                                  stateFIPS = "15",
                                  countycode = "001",
                                  sitenum = "0007"
                                 )
         
## End(Not run)

aqs_monitors_by_state

Description

[Stable] Returns a table of monitors and related metadata at sites with the provided parameter, and stateFIPS for bdate - edate time frame.

Usage

aqs_monitors_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of monitors from the selected state

by_state aggregate functions

NA

Note

All monitors that operated between the bdate and edate will be returned

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble of SO2 monitors in Hawaii
          #  that were operating on May 01, 2017
 ## Not run: aqs_monitors_by_state(parameter="88101",
                                  bdate=as.Date("20170101",
                                                 format="%Y%m%d"),
                                  edate=as.Date("20171231",
                                                 format="%Y%m%d"),
                                  stateFIPS="01"
                                  )
          
## End(Not run)

aqs_parameters_by_class

Description

[Stable] Returns parameters associated with the input class.

Usage

aqs_parameters_by_class(class, return_header = FALSE)

Arguments

class

a R character object that represents the class requested, @seealso aqs_classes() for retrieving available classes. The class R character object must be a valid class as returned from aqs_classes(). The class must be an exact match to what is returned from aqs_classes() (case sensitive).

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing the parameters associated with the class requested. NULL is returned for classes not found.

Examples

# Returns a tibble of AQS parameters in the criteria class
          ## Not run:  aqs_parameters_by_class(class = "CRITERIA")

aqs_pqaos

Description

[Stable] Returns a table of primary quality assurance organizations (pqaos).

Usage

aqs_pqaos(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of pqaos and their associated pqao code.

Examples

# Returns a tibble of primary quality assurance
          # organizations (pqaos)
           ## Not run:  aqs_pqaos()

aqs_qa_annualpeferomanceeval_by_site

Description

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance_by* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance_by* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance_by* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance_by* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance_by* functions, please use these functions instead.

[Deprecated] aqs_qa_annualpeferomanceeval_by* functions have been renamed to aqs_qa_annualperformance_by* functions, please use these functions instead.

Usage

aqs_qa_annualpeferomanceeval_by_site()

aqs_qa_annualpeferomanceeval_by_county()

aqs_qa_annualpeferomanceeval_by_state()

aqs_qa_annualpeferomanceeval_by_pqao()

aqs_qa_annualpeferomanceeval_by_MA()

aqs_qa_annualpeferomanceevaltransaction_by_site()

aqs_qa_annualpeferomanceevaltransaction_by_county()

aqs_qa_annualpeferomanceevaltransaction_by_pqao()

aqs_qa_annualpeferomanceevaltransaction_by_MA()

aqs_qa_annualperformanceeval_by_county

Description

[Stable] Returns AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by county for a parameter code aggregated by matching input parameter, countycode and stateFIPS provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceeval_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data. for single monitoring site for the sitenum, countycode and stateFIPS requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluation data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# Returns a tibble containing annual performance evaluation data
          # (raw) for ozone in Baldwin County, AL for 2017 in RD format.
 ## Not run:  aqs_qa_annualperformanceeval_by_county(parameter = "44201",
                                                  bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20171231",
                                                           format = "%Y%m%d"),
                                                  stateFIPS = "01",
                                                  countycode = "003"
                                                  )
                 
## End(Not run)

aqs_qa_annualperformanceeval_by_MA

Description

[Stable] Returns quality assurance performance evaluation data - aggregated by by Monitoring agency (MA) for a parameter code aggregated by matching input parameter and MA_code for the time frame between bdate and edate.

Usage

aqs_qa_annualperformanceeval_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data. for all monitoring sites for with the MA_code requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluation data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceevaltransaction_by_MA(), aqs_qa_blanks_by_MA(), aqs_qa_collocated_assessments_by_MA(), aqs_qa_flowrateaudit_by_MA(), aqs_qa_flowrateverification_by_MA(), aqs_qa_one_point_qc_by_MA(), aqs_qa_pep_audit_by_MA()

Examples

# Returns a tibble containing annual performance evaluation data
          #  for ozone where the monitoring agency is the Alabama Department
          #  of Environmental Management (MA_code 0013).
          ## Not run: aqs_qa_annualperformanceeval_by_MA(parameter = "44201",
                                                  bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                          MA_code = "0013"
                                                     )
                  
## End(Not run)

aqs_qa_annualperformanceeval_by_pqao

Description

[Stable] Returns quality assurance performance evaluation data - aggregated by Primary Quality Assurance Organization (PQAO) for a parameter code aggregated by matching input parameter and pqao_code for the time frame between bdate and edate.

Usage

aqs_qa_annualperformanceeval_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data. for single monitoring site for the pqao_code requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluation data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceevaltransaction_by_pqao(), aqs_qa_blanks_by_pqao(), aqs_qa_collocated_assessments_by_pqao(), aqs_qa_flowrateaudit_by_pqao(), aqs_qa_flowrateverification_by_pqao(), aqs_qa_one_point_qc_by_pqao(), aqs_qa_pep_audit_by_pqao()

Examples

# Returns a tibble containing annual performance evaluation data
          # for ozone where the PQAO is the Alabamaba Department of
          # Environmental Management (pqao_code 0013).
 ## Not run:  aqs_qa_annualperformanceeval_by_pqao(parameter = "44201",
                                                bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                pqao_code = "0013"
                                                )
                 
## End(Not run)

aqs_qa_annualperformanceeval_by_site

Description

[Stable] Returns quality assurance performance evaluation data - aggregated by site for a parameter code aggregated by matching input parameter, sitenum, countycode and stateFIPS provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceeval_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data. for single monitoring site for the sitenum, countycode and stateFIPS requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluation data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

#Returns a tibble containing annual performance evaluation data for
          # ozone at the Fairhope site in Baldwin County, AL for 2017
 ## Not run:   aqs_qa_annualperformanceeval_by_site(parameter = "44201",
                                                 bdate = as.Date("20170101",
                                                         format = "%Y%m%d"),
                                                 edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                 stateFIPS = "01",
                                                 countycode = "003",
                                                 sitenum = "0010"
                                                 )
                 
## End(Not run)

aqs_qa_annualperformanceeval_by_state

Description

[Stable] Returns quality assurance performance evaluation data - aggregated by state for a parameter code aggregated by matching input parameter, countycode and stateFIPS provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceeval_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data. for single monitoring site for the sitenum, countycode and stateFIPS requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluation data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_state functions: aqs_qa_annualperformanceevaltransaction_by_state(), aqs_quarterlysummary_by_box(), aqs_quarterlysummary_by_cbsa(), aqs_quarterlysummary_by_state(), aqs_transactionsample_by_MA(), aqs_transactionsample_by_state()

Examples

# Returns a tibble containing annual performance evaluation
          # data for ozone in Alabamba for 2017.
 ## Not run:  aqs_qa_annualperformanceeval_by_state(parameter = "44201",
                                                  bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                  stateFIPS = "01"
                                                  )
                 
## End(Not run)

aqs_qa_annualperformanceevaltransaction_by_site

Description

[Stable] Returns AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by site for a parameter code aggregated by matching input parameter, countycode and stateFIPS provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceevaltransaction_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data in the RD format for a single monitoring site for the countycode and stateFIPS requested for the time frame between bdate and edate in the AQS. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluations transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

# Returns a tibble containing annual performance evaluation data
          # (raw) for ozone in Baldwin County, AL for 2017 in RD format.
 ## Not run: aqs_qa_annualperformanceevaltransaction_by_county(parameter = "44201",
                                                  bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                  stateFIPS = "01",
                                                  countycode = "003"
                                                  )
                 
## End(Not run)

aqs_qa_annualperformanceevaltransaction_by_MA

Description

[Stable] Returns AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by Monitoring agency (MA) for a parameter code aggregated by matching input parameter and MA_code provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceevaltransaction_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data in the AQS submissions transaction format (RD)for all sites matching the MA_code requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluations transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceeval_by_MA(), aqs_qa_blanks_by_MA(), aqs_qa_collocated_assessments_by_MA(), aqs_qa_flowrateaudit_by_MA(), aqs_qa_flowrateverification_by_MA(), aqs_qa_one_point_qc_by_MA(), aqs_qa_pep_audit_by_MA()

Examples

# Returns a tibble containing annual performance evaluation data
          #  for ozone in where the MA is the Alabama Department of
          #  Environmental Management (MA_code 0013) for 2017 in RD format.
 ## Not run: aqs_qa_annualperformanceevaltransaction_by_MA(parameter = "44201",
                                                  bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                  MA_code = "0013"
                                                        )
         
## End(Not run)

aqs_qa_annualperformanceevaltransaction_by_pqao

Description

[Stable] Returns AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by Primary Quality Assurance Organization (PQAO) for a parameter code aggregated by matching input parameter and pqao_code provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceevaltransaction_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data. for single monitoring site for the sitenum, countycode and stateFIPS requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluations transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceeval_by_pqao(), aqs_qa_blanks_by_pqao(), aqs_qa_collocated_assessments_by_pqao(), aqs_qa_flowrateaudit_by_pqao(), aqs_qa_flowrateverification_by_pqao(), aqs_qa_one_point_qc_by_pqao(), aqs_qa_pep_audit_by_pqao()

Examples

#Returns a tibble containing annual performance evaluation data for
          # ozone in where the PQAO is the Alabama Department of
          # Environmental Management (pqao_code 0013) for 2017 in RD format.
 ## Not run: aqs_qa_annualperformanceevaltransaction_by_pqao(parameter =
                                                                     "44201",
                                                bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                pqao_code = "0013"
                                               )
                 
## End(Not run)

aqs_qa_annualperformanceevaltransaction_by_site

Description

[Stable] Returns AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by site for a parameter code aggregated by matching input parameter, sitenum, countycode and stateFIPS provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceevaltransaction_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance annual performance evaluation data in the RD format for a single monitoring site for the sitenum, countycode and stateFIPS requested for the time frame between bdate and edate in the AQS. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluations transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

#Returns a tibble containing annual performance evaluation data
          # (raw) for ozone at the Fairhope site in Baldwin County, AL for
          # 2017 in RD format.
## Not run: aqs_qa_annualperformanceevaltransaction_by_site(parameter = "44201",
                                                  bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                            stateFIPS = "01",
                                                          countycode = "003",
                                                             sitenum = "0010"
                                                               )
                 
## End(Not run)

aqs_qa_annualperformanceevaltransaction_by_state

Description

[Stable] Returns AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by state for a parameter code aggregated by matching input parameter and stateFIPS provided for bdate - edate time frame.

Usage

aqs_qa_annualperformanceevaltransaction_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of quality assurance performance evaluation data. for single monitoring site for the sitenum, countycode and stateFIPS requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quality assurance Annual Performance Evaluations transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_state functions: aqs_qa_annualperformanceeval_by_state(), aqs_quarterlysummary_by_box(), aqs_quarterlysummary_by_cbsa(), aqs_quarterlysummary_by_state(), aqs_transactionsample_by_MA(), aqs_transactionsample_by_state()

Examples

# Returns a tibble containing annual performance evaluation data
          # for ozone in Alabmba for 2017 in RD format.
## Not run: 
        aqs_qa_annualperformanceevaltransaction_by_state(parameter = "44201",
                                                  bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20171231",
                                                           format = "%Y%m%d")
                                                         stateFIPS = "01"
                                                         )
         
## End(Not run)

aqs_qa_blanks_by_county

Description

[Stable] Returns a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated at the county level.

Usage

aqs_qa_blanks_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object that contains quality assurance blank sample data for all monitors within the input stateFIPS and countycode. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of qa_blank data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns a tibble with PM2.5 blank data for
          #  Colbert County, AL for January 2018
   ## Not run: aqs_qa_blanks_by_county(parameter = "88101",
                                    bdate = as.Date("20170101",
                                                   format="%Y%m%d"),
                                    edate = as.Date("20190131",
                                                    format="%Y%m%d"),
                                    stateFIPS = "01",
                                    countycode = "033"
                                   )
           
## End(Not run)

aqs_qa_blanks_by_MA

Description

[Stable] Returns a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated by monitoring agency code (MA_code).

Usage

aqs_qa_blanks_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object that contains quality assurance blank sample data for all monitors within the input MA_code. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

by_ma aggregate functions

NA

Note

The AQS API only allows for a single year of qa_blank data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceeval_by_MA(), aqs_qa_annualperformanceevaltransaction_by_MA(), aqs_qa_collocated_assessments_by_MA(), aqs_qa_flowrateaudit_by_MA(), aqs_qa_flowrateverification_by_MA(), aqs_qa_one_point_qc_by_MA(), aqs_qa_pep_audit_by_MA()

Examples

# Returns a tibble containing PM2.5 blank data in
          #  January 2018 where the Monitoring Agency is the Alabama
          #  Department of Environmental Management (agency 0013)
          ## Not run: aqs_qa_blanks_by_MA(parameter = "88101",
                                       bdate = as.Date("20170101",
                                                       format = "%Y%m%d"),
                                       edate = as.Date("20190131",
                                                       format = "%Y%m%d"),
                                       MA_code = "0013"
                                       )
                   
## End(Not run)

aqs_qa_blanks_by_pqao

Description

[Stable] Returns a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated by Primary Quality Assurance Organization (PQAO).

Usage

aqs_qa_blanks_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance blank data for monitors within a pqao. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

by_pqao aggregate functions

NA

Note

The AQS API only allows for a single year of flow rate audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceeval_by_pqao(), aqs_qa_annualperformanceevaltransaction_by_pqao(), aqs_qa_collocated_assessments_by_pqao(), aqs_qa_flowrateaudit_by_pqao(), aqs_qa_flowrateverification_by_pqao(), aqs_qa_one_point_qc_by_pqao(), aqs_qa_pep_audit_by_pqao()

Examples

# Returns tibble of PM2.5 blank data in
          #  January 2018 where the PQAO is the Alabama Department of
          #  Environmental Management (agency 0013)
          ## Not run: aqs_qa_blanks_by_pqao(parameter = "88101",
                                         bdate = as.Date("20180101",
                                                         format = "%Y%m%d"),
                                         edate = as.Date("20180131",
                                                         format = "%Y%m%d"),
                                         pqao_code = "0013"
                                         )
                   
## End(Not run)

aqs_qa_blanks_by_site

Description

[Stable] Returns a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated at the site level.

Usage

aqs_qa_blanks_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object that contains quality assurance blank sample data for single monitoring site for the sitenum, countycode and stateFIPS requested for the time frame between bdate and edate. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of qa_blank data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

#Returns a tibble of PM2.5 blank
          #  data for the Muscle Shoals site (#0014) in Colbert County, AL
          #  for January 2018
          ## Not run: 
                    aqs_qa_blanks_by_site(parameter = "88101",
                                          bdate = as.Date("20170101",
                                                          format="%Y%m%d"),
                                          edate = as.Date("20190131",
                                                          format="%Y%m%d"),
                                          stateFIPS = "01",
                                          countycode = "033",
                                          sitenum = "1002"
                                          )
                 
## End(Not run)

aqs_qa_blanks_by_state

Description

[Stable] Returns a table of blank quality assurance data . Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated at the state level.

Usage

aqs_qa_blanks_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object that contains quality assurance blank sample data for all monitors within the input stateFIPS. An AQS_Data_Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of qa_blank data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble which contains PM2.5 blank data
          #  for Alabama for January 2018
          ## Not run: aqs_qa_blanks_by_state(parameter = "88101",
                                          bdate = as.Date("20180101",
                                                          format = "%Y%m%d"
                                                         ),
                                          edate = as.Date("20180131",
                                          format = "%Y%m%d"),
                                          stateFIPS = "01"
                                          )
                   
## End(Not run)

aqs_qa_collocated_assessments_by_county

Description

[Stable] Returns a table of collocated assessment data aggregated by matching input parameter, stateFIPS and county_code provided for bdate - edate time frame.

Usage

aqs_qa_collocated_assessments_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance collocated assessment data for monitors within a county. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of collocated assessments data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# Returns a tibble with collocated assessment data
          #  for FRM PM2.5 in Madison County, AL for January 2015
 ## Not run: aqs_qa_collocated_assessments_by_county(parameter = "88101",
                                                  bdate = as.Date("20150101",
                                                            format = "%Y%m%d"
                                                                 ),
                                                  edate = as.Date("20150131",
                                                            format = "%Y%m%d"
                                                                 ),
                                                  stateFIPS = "01",
                                                  countycode = "089"
                                                  )
         
## End(Not run)

aqs_qa_collocated_assessments_by_MA

Description

[Stable] Returns a table of collocated assessment data aggregated by matching input parameter, and monitoring agency (MA) code provided for bdate - edate time frame.

Usage

aqs_qa_collocated_assessments_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance collocated assessment data for monitors within a monitoring agency. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of collocated assessments data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceeval_by_MA(), aqs_qa_annualperformanceevaltransaction_by_MA(), aqs_qa_blanks_by_MA(), aqs_qa_flowrateaudit_by_MA(), aqs_qa_flowrateverification_by_MA(), aqs_qa_one_point_qc_by_MA(), aqs_qa_pep_audit_by_MA()

Examples

# Returns a tibble containing collocated assessment
          #   data for FRM PM2.5 January 2013 where the Monitoring Agency is
          #   the Alabama Department of Environmental Management
          # (agency 0013)
          ## Not run: aqs_qa_collocated_assessments_by_MA(parameter="88101",
                                                  bdate = as.Date("20130101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20150131",
                                                            format="%Y%m%d"),
                                                  MA_code = "0013"
                                                       )
                   
## End(Not run)

aqs_qa_collocated_assessments_by_pqao

Description

[Stable] Returns a table of collocated assessment data aggregated by matching input parameter, and Primary Quality Assurance Organisation (PQAO) code provided for bdate - edate time frame.

Usage

aqs_qa_collocated_assessments_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance collocated assessment data for monitors within a pqao. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of collocated assessments data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceeval_by_pqao(), aqs_qa_annualperformanceevaltransaction_by_pqao(), aqs_qa_blanks_by_pqao(), aqs_qa_flowrateaudit_by_pqao(), aqs_qa_flowrateverification_by_pqao(), aqs_qa_one_point_qc_by_pqao(), aqs_qa_pep_audit_by_pqao()

Examples

# Returns a tibble of collocated assessment
          #  data for FRM PM2.5 in January 2013 where the PQAO is the Alabama
          #  Department of Environmental Management (agency 0013)
          ## Not run: aqs_qa_collocated_assessments_by_pqao(parameter = "88101",
                                                  bdate = as.Date("20130101",
                                                          format = "%Y%m%d"),
                                                  edate = as.Date("20150131",
                                                          format = "%Y%m%d"),
                                                        pqao_code = "0013"
                                                        )
                   
## End(Not run)

aqs_qa_collocated_assessments_by_site

Description

[Stable] Returns a table of collocated assessment data aggregated by matching input parameter, stateFIPS, county_code, and sitenum provided for bdate - edate time frame.

Usage

aqs_qa_collocated_assessments_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance collocated assessment data for monitors within a site. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of collocated assessments data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

#returns a tibble of collocated assessment data
          #  for FRM PM2.5 at the Huntsville Old Airport site (\#0014)
          #  in Madison County, AL for January 2015:
 ## Not run: aqs_qa_collocated_assessments_by_site(parameter = "88101",
                                                bdate = as.Date("20150101",
                                                            format = "%Y%m%d"
                                                               ),
                                                edate = as.Date("20150131",
                                                            format = "%Y%m%d"
                                                                ),
                                                stateFIPS = "01",
                                                countycode = "089",
                                                sitenum = "0014"
                                                )
         
## End(Not run)

aqs_qa_collocated_assessments_by_state

Description

[Stable] Returns a table of collocated assessment data aggregated by matching input parameter and stateFIPS provided for bdate - edate time frame.

Usage

aqs_qa_collocated_assessments_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance collocated assessment data for monitors within a state. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of collocated assessments data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble  of collocated
          #  assessment data for FRM2.5 for January 2013
          ## Not run: aqs_qa_collocated_assessments_by_state(parameter="88101",
                                                  bdate = as.Date("20130101",
                                                            format = "%Y%m%d"
                                                                 ),
                                                  edate = as.Date("20150131",
                                                            format = "%Y%m%d"
                                                                 ),
                                                             stateFIPS = "01"
                                                          )
                   
## End(Not run)

aqs_qa_flowrateaudit_by_county

Description

[Stable] Returns a table containing flow rate audit data aggregated by parameter code, stateFIPS and countycode for bdate - edate time frame.

Usage

aqs_qa_flowrateaudit_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing flow rate audit data for the requested countycode and stateFIPS. An AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

#Returns a tibble of flow rate audit data for
          #  Jefferson County, AL for January 2018
   ## Not run: aqs_qa_flowrateaudit_by_county(parameter = "88101",
                                           bdate = as.Date("20170101",
                                                         format="%Y%m%d"),
                                           edate = as.Date("20190131",
                                                         format = "%Y%m%d"),
                                           tateFIPS = "01",
                                           countycode = "073"
                                           )
           
## End(Not run)

aqs_qa_flowrateaudit_by_MA

Description

[Stable] Returns a table containing flow rate audit data aggregated by parameter code and monitoring agency code (_by_MA) for bdate - edate time frame.

Usage

aqs_qa_flowrateaudit_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing flow rate audit data for the requested MA_code. An AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceeval_by_MA(), aqs_qa_annualperformanceevaltransaction_by_MA(), aqs_qa_blanks_by_MA(), aqs_qa_collocated_assessments_by_MA(), aqs_qa_flowrateverification_by_MA(), aqs_qa_one_point_qc_by_MA(), aqs_qa_pep_audit_by_MA()

Examples

# returns a tibble of flow rate audit data
 #   for FRM PM2.5 January 2016 - Januray 2018 where the Monitoring Agency is
 #   the Jefferson County, AL  Department of Health (agency 0550)
 ## Not run: aqs_qa_flowrateaudit_by_MA(parameter = "88101",
                                     bdate = as.Date("20160101",
                                                  format = "%Y%m%d"),
                                     edate = as.Date("20180131",
                                                     format = "%Y%m%d"),
                                     MA_code = "0550"
                                     )
         
## End(Not run)

aqs_qa_flowrateaudit_by_pqao

Description

[Stable] Returns a table containing flow rate audit data aggregated by parameter code and Primary Quality Assurance Organization (PQAO) code for bdate - edate time frame.

Usage

aqs_qa_flowrateaudit_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing flow rate audit data for the requested pqao_code. An AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceeval_by_pqao(), aqs_qa_annualperformanceevaltransaction_by_pqao(), aqs_qa_blanks_by_pqao(), aqs_qa_collocated_assessments_by_pqao(), aqs_qa_flowrateverification_by_pqao(), aqs_qa_one_point_qc_by_pqao(), aqs_qa_pep_audit_by_pqao()

Examples

# Returns a tibble of flow rate audit data for January
  #  2018 where the PQAO is the Jefferson County, AL Department of
  #  Health (agency 0550).
  ## Not run: aqs_qa_flowrateaudit_by_pqao(parameter = "88101",
                                        bdate = as.Date("20170101",
                                                        format = "%Y%m%d"),
                                        edate = as.Date("20180131",
                                                        format = "%Y%m%d"),
                                        pqao_code = "0550"
                                       )
          
## End(Not run)

aqs_qa_flowrate audit_by_site

Description

[Stable] Returns a table containing flow rate audit data aggregated by parameter code, stateFIPS, countycode and site number for bdate - edate time frame.

Usage

aqs_qa_flowrateaudit_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing flow rate audit data for the requested sitenum, countycode and stateFIPS. An AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

# returns a tibble of flow rate audit data
          #  for the Wylam site (#2003) in Jefferson County, AL
          #  for January 2018:
 ## Not run: aqs_qa_flowrateaudit_by_site(parameter = "88101",
                                                 bdate = as.Date("20150101",
                                                            format="%Y%m%d"),
                                                 edate = as.Date("20180131",
                                                            format="%Y%m%d"),
                                                 stateFIPS = "01",
                                                 countycode = "073",
                                                 sitenum = "2003"
                                                 )
           
## End(Not run)

aqs_qa_flowrateaudit_by_state

Description

[Stable] Returns a table containing flow rate audit data aggregated by parameter code and stateFIPS for bdate - edate time frame.

Usage

aqs_qa_flowrateaudit_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing flow rate audit data for the requested stateFIPS. An AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble of flow rate audit
          #  data for Alabama in January 2018
          ## Not run: aqs_qa_flowrateaudit_by_state(parameter = "88101",
                                                 bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                 edate = as.Date("20180131",
                                                          format = "%Y%m%d"),
                                                 stateFIPS = "01"
                                                 )
                   
## End(Not run)

aqs_qa_flowrateverification_by_county

Description

[Stable] Returns a table containing flow rate Verification data for a parameter code aggregated matching input parameter, stateFIPS, and county_code, provided for bdate - edate time frame.

Usage

aqs_qa_flowrateverification_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance flow rate verification data for monitors within a county. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate verifications to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns a tibble of flow rate verification data for
          #  Colbert County, AL for January 2018
  ## Not run: aqs_qa_flowrateverification_by_county(parameter = "88101",
                                                 bdate = as.Date("20180101",
                                                            format = "%Y%m%d"
                                                                 ),
                                                 edate = as.Date("20190131",
                                                            format = "%Y%m%d"
                                                                ),
                                                 stateFIPS = "01",
                                                 countycode = "033"
                                                   )
           
## End(Not run)

aqs_qa_flowrateverification_by_MA

Description

[Stable] Returns a table containing flow rate Verification data for a parameter code aggregated by matching input parameter, and monitoring agency (MA) code provided for bdate - edate time frame.

Usage

aqs_qa_flowrateverification_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance flow rate verification data for monitors within a Monitoring agency. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate verifications to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceeval_by_MA(), aqs_qa_annualperformanceevaltransaction_by_MA(), aqs_qa_blanks_by_MA(), aqs_qa_collocated_assessments_by_MA(), aqs_qa_flowrateaudit_by_MA(), aqs_qa_one_point_qc_by_MA(), aqs_qa_pep_audit_by_MA()

Examples

# Returns a tibble containing collocated assessment
  #   data for FRM PM2.5 January 2013 where the Monitoring Agency is
  #   the Alabama Department of Environmental Management (agency 0013)
  ## Not run: aqs_qa_flowrateverification_by_MA(parameter = "88101",
                                             bdate = as.Date("20130101",
                                                            format = "%Y%m%d"
                                                            ),
                                             edate = as.Date("20150131",
                                                           format = "%Y%m%d"
                                                            ),
                                             MA_code = "0013"
                                             )
          
## End(Not run)

aqs_qa_flowrateverification_by_pqao

Description

[Stable] Returns a table containing flow rate Verification data for a parameter code aggregated by matching input parameter, and Primary Quality Assurance Organization (PQAO) code provided for bdate - edate time.

Usage

aqs_qa_flowrateverification_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance flow rate verification data for monitors within a pqao. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate verifications to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceeval_by_pqao(), aqs_qa_annualperformanceevaltransaction_by_pqao(), aqs_qa_blanks_by_pqao(), aqs_qa_collocated_assessments_by_pqao(), aqs_qa_flowrateaudit_by_pqao(), aqs_qa_one_point_qc_by_pqao(), aqs_qa_pep_audit_by_pqao()

Examples

# returns a tibble of flow rate verification
  #  data for January 2018 where the PQAO is the Alabama Department
  #  of Environmental Management (agency 0013)
  ## Not run: aqs_qa_flowrateverification_by_pqao(parameter = "88101",
                                               bdate = as.Date("20170101",
                                                            format = "%Y%m%d"
                                                              ),
                                               edate = as.Date("20190131",
                                                            format = "%Y%m%d"
                                                              ),
                                               pqao_code = "0013"
                                               )
         
## End(Not run)

aqs_qa_flowrateverification_by_site

Description

[Stable] Returns a table containing flow rate Verification data for a parameter code aggregated matching input parameter, stateFIPS, county_code, and sitenum provided for bdate - edate time frame.

Usage

aqs_qa_flowrateverification_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance flow rate verification data for monitors at a site. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate verifications to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

# returns a tibble of flow rate verification
          #  data for the Muscle Shoals site (#1002) in Colbert County, AL
          #  for January 2018:
 ## Not run: aqs_qa_flowrateverification_by_site(parameter = "88101",
                                              bdate = as.Date("20170101",
                                                         format = "%Y%m%d"),
                                              edate = as.Date("20180131",
                                                         format = "%Y%m%d"),
                                             stateFIPS = "01",
                                             countycode = "033",
                                             sitenum = "1002"
                                               )
          
## End(Not run)

aqs_qa_flowrateverification_by_state

Description

[Stable] Returns a table containing flow rate Verification data for a parameter code aggregated matching input parameter, and stateFIPS, provided for bdate - edate time frame.

Usage

aqs_qa_flowrateverification_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance flow rate verification data for monitors within a state. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of flow rate verifications to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# Returns a tibble of flow rate verification data for the state of
          # Alabama for 2017-2019
          ## Not run: aqs_qa_flowrateverification_by_state(parameter = "88101",
                                                  bdate = as.Date("20170101",
                                                            format = "%Y%m%d"
                                                                  ),
                                                  edate = as.Date("20190131",
                                                              format="%Y%m%d"
                                                                  ),
                                                  stateFIPS = "01"
                                                        )
                   
## End(Not run)

aqs_qa_one_point_qc_by_county_

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object containing one point QC check data aggregated by county_code.

Usage

aqs_qa_one_point_qc_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing one point qc data within a county. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of one point qc data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

#returns a tibble of One Point QC data for ozone
          #  in Barnstable County, MA for January 2018
  ## Not run: aqs_qa_one_point_qc_by_county(parameter= "44201",
                                         bdate = as.Date("20170101",
                                                       format = "%Y%m%d"),
                                         edate = a s.Date("20180131",
                                                         format = "%Y%m%d"),
                                         stateFIPS = "25",
                                         countycode = "001"
                                         )
           
## End(Not run)

aqs_qa_one_point_qc_by_MA

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object containing one point QC check data aggregated by monitoring agency code (_by_MA).

Usage

aqs_qa_one_point_qc_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing one point qc data for a single monitoring agency. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of one point qc data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceeval_by_MA(), aqs_qa_annualperformanceevaltransaction_by_MA(), aqs_qa_blanks_by_MA(), aqs_qa_collocated_assessments_by_MA(), aqs_qa_flowrateaudit_by_MA(), aqs_qa_flowrateverification_by_MA(), aqs_qa_pep_audit_by_MA()

Examples

# returns a tibble of ozone One Point QC data
          #  in January 2018 where the Monitoring Agency is the
          #  Massachusetts Department of Environmental Protection
          #  (agency 0660)
          ## Not run: aqs_qa_one_point_qc_by_MA(parameter = "44201",
                                             bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                             edate = as.Date("20180131",
                                                          format = "%Y%m%d"),
                                             MA_code = "0660"
                                            )
                   
## End(Not run)

aqs_qa_one_point_qc_by_pqao

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object containing Quality assurance data - collocated assessment raw data aggregated by Primary Quality Assurance Organization (PQAO) code.

Usage

aqs_qa_one_point_qc_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing one point qc data within a pqao. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item

Note

The AQS API only allows for a single year of one point qc data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceeval_by_pqao(), aqs_qa_annualperformanceevaltransaction_by_pqao(), aqs_qa_blanks_by_pqao(), aqs_qa_collocated_assessments_by_pqao(), aqs_qa_flowrateaudit_by_pqao(), aqs_qa_flowrateverification_by_pqao(), aqs_qa_pep_audit_by_pqao()

Examples

# returns a tibble of ozone One Point QC
 #  data for Jan 2017 - January 2018 where the PQAO is the Massachusetts
 #  Department of Environmental Protection (agency 0660)
 ## Not run: aqs_qa_one_point_qc_by_pqao(parameter = "88101",
                                      bdate = as.Date("20170101",
                                                      format = "%Y%m%d"),
                                      edate = as.Date("20180131",
                                                    format = "%Y%m%d"),
                                      pqao_code = "0660"
                                     )
         
## End(Not run)

aqs_qa_one_point_qc_by_site

Description

[Stable] Returns a table of one point QC raw data aggregated by parameter code, stateFIPS, countycode and site number.

Usage

aqs_qa_one_point_qc_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing one point qc data for the requested site. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of one point qc data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

# returns a tibbble of One Point QC data for
          #  ozone at the Truro National Seashore site (\#0002) in
          #  Barnstable County, MA for January 2018:
 ## Not run: aqs_qa_one_point_qc_by_site(parameter = "44201",
                                    bdate = as.Date("20180101",
                                                   format = "%Y%m%d"),
                                    edate = as.Date("20180131",
                                                   format = "%Y%m%d"),
                                    stateFIPS = "25",
                                    countycode = "001",
                                    sitenum = "0002"
                                    )
         
## End(Not run)

aqs_qa_one_point_qc_by_state

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object containing Quality assurance data - flow rate audit raw data aggregated by state FIPS.

Usage

aqs_qa_one_point_qc_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing one point qc data within a state. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of one point qc data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_pep_audit_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble of one point QC check
          #  data for ozone in Massachusettes in January 2018
          ## Not run: aqs_qa_one_point_qc_by_state(parameter = "44201",
                                                bdate = as.Date("20170101",
                                                            format = "%Y%m%d"
                                                                ),
                                                edate = as.Date("20190131",
                                                           format = "%Y%m%d"
                                                               ),
                                                stateFIPS = "25"
                                               )
                   
## End(Not run)

aqs_qa_pep_audit_by_county

Description

[Stable] Returns a table of Performance Evaluation Program (PEP) audit data aggregated by parameter code, stateFIPS and countycode for the time frame between bdate and edate.

Usage

aqs_qa_pep_audit_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance PEP audit data within a county. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of pep audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns a tibble with PEP Audit data for FRM
          #  PM2.5 in Madison County, AL for 2017
 ## Not run: aqs_qa_pep_audit_by_county_multiyear(parameter = "88101",
                                               bdate = as.Date("20150101",
                                                         format = "%Y%m%d"
                                                              ),
                                               edate = as.Date("20171231",
                                                           format = "%Y%m%d"
                                                              ),
                                               stateFIPS = "01",
                                               countycode = "089"
                                               )
          
## End(Not run)

aqs_qa_pep_audit_by_MA

Description

[Stable] Returns a table of Performance Evaluation Program (PEP) audit data aggregated by monitoring agency code (_by_MA) for the time frame between bdate and edate.

Usage

aqs_qa_pep_audit_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance PEP audit data for a monitoring agency. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of one point pep audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_MA functions: aqs_qa_annualperformanceeval_by_MA(), aqs_qa_annualperformanceevaltransaction_by_MA(), aqs_qa_blanks_by_MA(), aqs_qa_collocated_assessments_by_MA(), aqs_qa_flowrateaudit_by_MA(), aqs_qa_flowrateverification_by_MA(), aqs_qa_one_point_qc_by_MA()

Examples

# Returns a tibble of PEP audit data for
          #  June 2017 where the Monitoring Agency is the Alabama Department
          #  of Environmental Management (agency 0013)
          ## Not run: aqs_qa_pep_audit_by_MA(parameter = "88101",
                                          bdate = as.Date("20170601",
                                                          format = "%Y%m%d"),
                                          edate = as.Date("20170630",
                                                          format = "%Y%m%d"),
                                          MA_code = "0013"
                                         )
                   
## End(Not run)

aqs_qa_pep_audit_by_pqao

Description

[Stable] Returns a table of Performance Evaluation Program (PEP) audit data aggregated by Primary Quality Assurance Organization (PQAO) code for the time frame between bdate and edate.

Usage

aqs_qa_pep_audit_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance PEP audit data for a Primary Quality Assurance Organization. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of pep audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_pqao functions: aqs_qa_annualperformanceeval_by_pqao(), aqs_qa_annualperformanceevaltransaction_by_pqao(), aqs_qa_blanks_by_pqao(), aqs_qa_collocated_assessments_by_pqao(), aqs_qa_flowrateaudit_by_pqao(), aqs_qa_flowrateverification_by_pqao(), aqs_qa_one_point_qc_by_pqao()

Examples

# returns a tibble of PEP audit data for
          #  June 2017 where the pqao is the Alabama Department of
          #  Environmental Management (agency 0013)
  ## Not run: aqs_qa_pep_audit_by_pqao(parameter = "88101",
                                    bdate = as.Date("20170601",
                                                    format = "%Y%m%d"
                                                   ),
                                    edate = as.Date("20190630",
                                                    format = "%Y%m%d"),
                                    pqao_code = "0013"
                                    )
                   
## End(Not run)

aqs_qa_pep_audit_by_site

Description

[Stable] Returns a table of Performance Evaluation Program (PEP) audit data aggregated by parameter code, stateFIPS, countycode and site number for the time frame between bdate and edate.

Usage

aqs_qa_pep_audit_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance PEP audit data within a site. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of pep audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_sampledata_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

# returns a tibble of pep Audit data for FRM PM2.5
          #  at the Huntsville Old Airport site (\#0014) in Madison County,
          #  AL for 2017 - 2019.
 ## Not run: aqs_qa_pep_audit_by_site(parameter = "88101",
                                   bdate = as.Date("20170101",
                                                   format = "%Y%m%d"),
                                   edate = as.Date("20191231",
                                                   format = "%Y%m%d"),
                                   stateFIPS = "01",
                                   countycode = "089",
                                   sitenum = "0014"
                                   )
           
## End(Not run)

aqs_qa_pep_audit_by_state

Description

[Stable] Returns a table of Performance Evaluation Program (PEP) audit data aggregated by parameter code, and stateFIPS for the time frame between bdate and edate.

Usage

aqs_qa_pep_audit_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object containing quality assurance PEP audit data within a state. A AQS_Data_Mart_APIv2 object is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of one point pep audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_sampledata_by_state()

Examples

# returns a tibble of PEP audit data for PM2.5 in Alabama 2017
          ## Not run: aqs_qa_pep_audit_by_state_multiyear(parameter="88101",
                                             bdate=as.Date("20160101",
                                                          format="%Y%m%d"),
                                             edate=as.Date("20171231",
                                                           format="%Y%m%d"),
                                             stateFIPS="01"
                                             )
                   
## End(Not run)

aqs_quarterlysummary_by_box

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object of quarterly summary data aggregated by and area within a latitude/longitude bounding box.

Usage

aqs_quarterlysummary_by_box(
  parameter,
  bdate,
  edate,
  minlat,
  maxlat,
  minlon,
  maxlon,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

minlat

a R character object which represents the minimum latitude of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.

maxlat

a R character object which represents the maximum latitude of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.

minlon

a R character object which represents the minimum longitude of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.

maxlon

a R character object which represents the maximum longitude of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains quarterly summary statistics for an area within a latitude/longitude bounding box. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

    Also Note that for quarterly data, only the year portion of the bdate
    and edate are used and all 4 quarters in the year are returned.

See Also

Other Aggregate _by_state functions: aqs_qa_annualperformanceeval_by_state(), aqs_qa_annualperformanceevaltransaction_by_state(), aqs_quarterlysummary_by_cbsa(), aqs_quarterlysummary_by_state(), aqs_transactionsample_by_MA(), aqs_transactionsample_by_state()

Examples

# Returns a tibble containing ozone quarterly summaries
          #  in the vicinity of central Alabama for each quarter in
          #  between 2015 - 2017
          ## Not run: aqs_quarterlysummary_by_box(parameter = "44201",
                                               bdate = as.Date("20150101",
                                                          format = "%Y%m%d"),
                                               edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                               minlat = "33.3",
                                               maxlat = "33.6",
                                               minlon = "-87.0",
                                               maxlon = "-86.7"
                                              )
                   
## End(Not run)

aqs_quarterlysummary_by_cbsa

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object of quarterly summary data aggregated by stateFIPS.

Usage

aqs_quarterlysummary_by_cbsa(
  parameter,
  bdate,
  edate,
  cbsa_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

cbsa_code

a R character object which represents the 5 digit AQS Core Based Statistical Area code (the same as the census code, with leading zeros)

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains quarterly summary statistics for the given parameter for a stateFIPS. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

    Also Note that for quarterly data, only the year portion of the bdate
    and edate are used and all 4 quarters in the year are returned.

See Also

Other Aggregate _by_state functions: aqs_qa_annualperformanceeval_by_state(), aqs_qa_annualperformanceevaltransaction_by_state(), aqs_quarterlysummary_by_box(), aqs_quarterlysummary_by_state(), aqs_transactionsample_by_MA(), aqs_transactionsample_by_state()

Examples

# Returns a tibble of $NO_{2}$ quartyerly summary
          #  data the for Charlotte-Concord-Gastonia, NC cbsa for
          #  each quarter in 2017.
          ## Not run: aqs_quarterlysummary_by_cbsa(parameter = "42602",
                                                bdate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                                edate = as.Date("20171231",
                                                          format = "%Y%m%d"),
                                                cbsa_code = "16740"
                                                )
                   
## End(Not run)

aqs_quarterlysummary_by_county

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object of quarterly summary data aggregated by cbsa (Core Based Statistical Area) code.

Usage

aqs_quarterlysummary_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains quarterly summary statistics for the given parameter for a single countycode and stateFIPS combination. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

    Also Note that for quarterly data, only the year portion of the bdate
    and edate are used and all 4 quarters in the year are returned.

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns a tibble containing quarterly summaries for
          #  FRM/FEM PM2.5 data for Wake County, NC for each quarter of 2016
 ## Not run: aqs_quarterlysummary_by_county(parameter = "88101",
                                         bdate = as.Date("20160101",
                                                          format = "%Y%m%d"),
                                         edate = as.Date("20170228",
                                                          format = "%Y%m%d"),
                                         stateFIPS = "37",
                                         countycode = "183"
                                        )
         
## End(Not run)

aqs_quarterlysummary_by_site

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object of quarterly summary data aggregated by site with the provided parameternum, stateFIPS, county_code, and sitenum for bdate - edate time frame.

Usage

aqs_quarterlysummary_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains quarterly summary statistics for the given parameter for a single countycode and stateFIPS combination. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

    Also Note that for quarterly data, only the year portion of the bdate
    and edate are used and all 4 quarters in the year are returned.

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_sampledata_by_county(), aqs_transactionsample_by_county()

Examples

# returns a tibble containing quarterly summaries for
          #  FRM/FEM PM2.5 data for Millbrook School in Wake County, NC
          #  for each quarter of 2016
 ## Not run: aqs_quarterlysummary_by_site(parameter = "88101",
                                       bdate = as.Date("20160101",
                                                       format = "%Y%m%d"),
                                       edate = as.Date("20160331",
                                                       format = "%Y%m%d"),
                                       stateFIPS = "37",
                                       countycode = "183",
                                       sitenum = "0014"
                                       )
         
## End(Not run)

aqs_quarterlysummary_by_state

Description

[Stable] Returns a tibble or an AQS_Data Mart_APIv2 S3 object of quarterly summary data aggregated by stateFIPS.

Usage

aqs_quarterlysummary_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that contains quarterly summary statistics for the given parameter for a stateFIPS. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Note

The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

    Also Note that for quarterly data, only the year portion of the bdate
    and edate are used and all 4 quarters in the year are returned.

See Also

Other Aggregate _by_state functions: aqs_qa_annualperformanceeval_by_state(), aqs_qa_annualperformanceevaltransaction_by_state(), aqs_quarterlysummary_by_box(), aqs_quarterlysummary_by_cbsa(), aqs_transactionsample_by_MA(), aqs_transactionsample_by_state()

Examples

# Returns an aqs S3 object containing quarterly summaries for
          #  FRM/FEM PM2.5 data for North Carolina for each quater of  2016
 ## Not run: aqs_quarterlysummary_by_state(parameter = "88101",
                                        bdate = as.Date("20160101",
                                                        format = "%Y%m%d"),
                                        edate = as.Date("20171231",
                                                        format = "%Y%m%d"),
                                        stateFIPS = "37"
                                       )
         
## End(Not run)

aqs_removeheader

Description

[Stable] Coerces a single AQS_Data_Mart_APIv2 S3 object or a list of AQS_Data_Mart_APIv2 S3 objects into a single tibble object. This function decouples the $Data from the AQSAPI_v2 object and returns only the $Data portion as a tibble. If the input is a list of AQSAPI_v2 objects combines the $Data portion of each AQS_Data_Mart_APIv2 S3 object into a single tibble with $Header information discarded. Else returns the input with no changes.

Usage

aqs_removeheader(AQSobject)

Arguments

AQSobject

An object of AQSAPI_v2 or a list of AQSAPI_v2 objects.

Value

a tibble of the combined $data portions of the input AQS_Data_Mart_APIv2 S3 object with the $Header portion discarded.

Note

Since this function returns only the $Data portion of RAQSAPI_v2 objects this means that the $Header information will not be present in the object being returned.

Examples

## Not run:  AQSobject <- aqs_removeheader(AQSobject)

aqs_revisionhistory

Description

[Stable] Returns the change history to the AQS Data Mart API.

Usage

aqs_revisionhistory(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object that is the return value from the AQS API. A AQS_Data Mart_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

Examples

# Returns a DataFrame of the EPA AQS Data Mart API revision history
 #  \dontrun{aqs_revisionHistory()}

aqs_sampledata_by_box

Description

[Stable] Returns sample data where the data is aggregated by latitude/longitude bounding box (_by_box). If return_header is FALSE (default) this function returns a single dataframe with the requested data. If return_header is TRUE returns a list of AQSAPI_v2 objects where each index of the list is an individual RAQSAPI_v2 object returned from each successive call to the AQS API. RAQSAPI_v2 objects are two item list where the $Data portion contains data that contains sample air monitoring data at a site with the input parameter and cbsa_code provided for bdate - edate time frame. The $Header is a tibble of header information from the API call /(useful for debugging/). This function returns NULL is bdate > edate.

Usage

aqs_sampledata_by_box(
  parameter,
  bdate,
  edate,
  minlat,
  maxlat,
  minlon,
  maxlon,
  duration = NA_character_,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

minlat

a R character object which represents the minimum latitude of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.

maxlat

a R character object which represents the maximum latitude of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.

minlon

a R character object which represents the minimum longitude of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.

maxlon

a R character object which represents the maximum longitude of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object containing sample data for all monitors within the input latitude/longitude bounding box for a single parameter. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item /(/$Header/) is a tibble of header information from the AQS API and the second item /(/$Data/) is a tibble of the data returned.

Note

The AQS API only allows for a single year of sampledata to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_box functions: aqs_annualsummary_by_box(), aqs_monitors_by_box()

Examples

# Returns a tibble containing all ozone samples
             #  in the vicinity of central Alabama between
             #  May 1, 2015 - May 2, 2017
          ## Not run: aqs_sampledata_by_box(parameter = "44201",
                                         bdate = as.Date("20150501",
                                                         format = "%Y%m%d"),
                                         edate = as.Date("20170502",
                                                         format = "%Y%m%d"),
                                         minlat = "33.3",
                                         maxlat = "33.6",
                                         minlon = "-87.0",
                                         maxlon = "-86.7"
                                         )
                   
## End(Not run)

aqs_sampledata_by_cbsa

Description

[Stable] Returns sample data where the data is aggregated at the Core Based Statistical Area (cbsa) level. If return_header is FALSE (default) this function returns a single dataframe with the requested data. If return_header is TRUE returns a list of AQSAPI_v2 objects where each index of the list is an individual RAQSAPI_v2 object returned from each successive call to the AQS API. RAQSAPI_v2 objects are two item list where the $Data portion contains data that contains sample air monitoring data at a site with the input parameter and cbsa_code provided for bdate - edate time frame. The $Header is a tibble of header information from the API call /(useful for debugging/). This function returns NULL is bdate > edate.

Usage

aqs_sampledata_by_cbsa(
  parameter,
  bdate,
  edate,
  cbsa_code,
  duration = NA_character_,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

cbsa_code

a R character object which represents the 5 digit AQS Core Based Statistical Area code (the same as the census code, with leading zeros)

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object containing sample data for all monitors matching cbsa_code for the given parameter. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item /(/$Header/) is a tibble of header information from the AQS API and the second item /(/$Data/) is a tibble of the data returned.

Note

The AQS API only allows for a single year of sampledata to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. Fortunately this operation has a linear run time /(Big O notation: O/(n + 5 seconds/)/)

See Also

Other Aggregate _by_cbsa functions: aqs_annualsummary_by_cbsa(), aqs_dailysummary_by_cbsa(), aqs_monitors_by_cbsa()

Examples

# returns tibble which contains $NO_{2}$ data
          #  for Charlotte-Concord-Gastonia, NC cbsa for
          #  Janurary 1, 2015 - Janurary 01, 2017
          ## Not run: aqs_sampledata_by_cbsa(parameter = "42602",
                                          bdate = as.Date("20150101",
                                                          format = "%Y%m%d"),
                                          edate = as.Date("20170101",
                                                          format = "%Y%m%d"),
                                          cbsa_code = "16740"
                                         )
                   
## End(Not run)

aqs_sampledata_by_county

Description

[Stable] Returns a single tibble with the requested data. If return_header is TRUE returns a list of AQSAPI_v2 objects where each index of the list is an individual RAQSAPI_v2 object returned from each successive call to the AQS API. RAQSAPI_v2 objects are two item list where the $Data portion contains data that contains sample air monitoring data at a site with the input parameter, stateFIPS and county_code provided for bdate - edate time frame. The $Header is a tibble of header information from the API call /(useful for debugging/). This function returns NULL is bdate > edate.

Usage

aqs_sampledata_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  duration = NA_character_,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object containing sample data for all monitors matching stateFIPS and county_code for the given parameter. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item /(/$Header/) is a tibble of header information from the AQS API and the second item /(/$Data/) is a tibble of the data returned.

Note

The AQS API only allows for a single year of sampledata to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_transactionsample_by_county()

Examples

# returns all FRM/FEM PM2.5 data for Wake County, NC between
          #  January 1, 2015 - February 28, 2016
 ## Not run: aqs_sampledata_by_county(parameter = "88101",
                                   bdate = as.Date("20150101",
                                                   format = "%Y%m%d"),
                                   edate=as.Date("20160228",
                                                   format = "%Y%m%d"),
                                   stateFIPS = "37",
                                   countycode = "183"
                                   )
         
## End(Not run)

aqs_sampledata_by_site

Description

[Stable] Returns multiple years of data where sample data is aggregated at the site level. If return_header is FALSE (default) returns a single data frame with the requested data. If return_header is TRUE returns a list of AQSAPI_v2 objects where each index of the list is an individual RAQSAPI_v2 object returned from each successive calls to the AQS API. RAQSAPI_v2 objects are two item list where the $Data portion contains data that contains sample air monitoring data at a site with the input parameter, stateFIPS and county_code provided for bdate - edate time frame. The $Header is a tibble of header information from the API call /(useful for debugging/). Returns NULL is bdate > edate.

Usage

aqs_sampledata_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  duration = NA_character_,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) returns a single data frame with the data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested. This is mostly useful for debugging purposes, in case the user wishes to see the header information from each api call.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object containing sample data for a single site with the input parameter. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item /(/$Header/) is a tibble of header information from the AQS API and the second item /(/$Data/) is a tibble of the data returned.

Note

The AQS API only allows for a single year of sampledata to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_services_by_site(), aqs_transactionsample_by_site()

Examples

#Returns a table of ozone monitoring data for the Millbrook School
          # site (/#0014) in Wake County, NC for June 18, 2017.
 ## Not run: 
            aqs_sampledata_by_site(parameter = "44201",
                                   bdate = as.Date("20170618",
                                                   format = "%Y%m%d"),
                                   edate = as.Date("20190618",
                                                      format = "%Y%m%d"),
                                   stateFIPS = "37",
                                   countycode = "183",
                                   sitenum = "0014"
                                   )
         
## End(Not run)

aqs_sampledata_by_state

Description

[Stable] Returns sample data where the data is aggregated at the state level. If return_header is FALSE (default) this function returns a single dataframe with the requested data. If return_header is TRUE returns a list of AQSAPI_v2 objects where each index of the list is an individual RAQSAPI_v2 object returned from each successive call to the AQS API. RAQSAPI_v2 objects are two item list where the $Data portion contains data that contains sample air monitoring data at a site with the input parameter and stateFIPS provided for bdate - edate time frame. The $Header is a tibble of header information from the API call /(useful for debugging/). This function returns NULL is bdate > edate.

Usage

aqs_sampledata_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  duration = NA_character_,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data_Mart_APIv2 S3 object containing sample data for all monitors matching stateFIPS for the given parameter. An AQS_Data Mart_APIv2 is a 2 item named list in which the first item /(/$Header/) is a tibble of header information from the AQS API and the second item /(/$Data/) is a tibble of the data returned.

Note

The AQS API only allows for a single year of sampledata to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate_by_state functions: aqs_annualsummary_by_state(), aqs_dailysummary_by_state(), aqs_monitors_by_state(), aqs_qa_blanks_by_state(), aqs_qa_collocated_assessments_by_state(), aqs_qa_flowrateaudit_by_state(), aqs_qa_flowrateverification_by_state(), aqs_qa_one_point_qc_by_state(), aqs_qa_pep_audit_by_state()

Examples

# Returns a tibble with all benzene samples from
          #  North Carolina collected from May 15th, 1995 - May 15, 1999
          ## Not run: aqs_sampledata_by_state(parameter = "45201",
                                           bdate = as.Date("19950515",
                                                           format="%Y%m%d"
                                                           ),
                                           edate = as.Date("19990515",
                                                          format = "%Y%m%d"),
                                           stateFIPS = "37"
                                          )
                   
## End(Not run)

aqs_sampledurations

Description

[Stable] Returns a table of sample durations and their associated duration codes. Returned values are not calculated durations such as 8 hour CO or O$_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages.

Usage

aqs_sampledurations(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of sample durations and their associated duration codes (groups of parameters, i.e. "criteria" or "all").

Note

Not all sample durations that are available through AQS are available through the AQS Data Mart API, including certain calculated sample durations. Only sample durations that are available through the AQS Data Mart API are returned.

Examples

# Returns a tibble or an AQS_Data Mart_APIv2 S3 object of
         ## Not run:  aqs_sampledurations()

aqs_services_by_box

Description

a helper function that abstracts the formatting of the inputs for a call to aqs away from the calling function for aggregations by a box formed by minimum/maximum latitude/longitude coordinates then calls the aqs and returns the result. This helper function is not meant to be called directly from external functions.

Usage

aqs_services_by_box(
  parameter,
  bdate,
  edate,
  minlat,
  maxlat,
  minlon,
  maxlon,
  duration = NA_character_,
  service,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

minlat

a R character object which represents the minimum latitude of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.

maxlat

a R character object which represents the maximum latitude of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.

minlon

a R character object which represents the minimum longitude of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.

maxlon

a R character object which represents the maximum longitude of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

service

a string which represents the services provided by the AQS API. For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.


aqs_services_by_cbsa

Description

a helper function that abstracts the formatting of the inputs for a call to aqs away from the calling function for aggregations by cbsa then calls the aqs and returns the result. This helper function is not meant to be called directly from external functions.

Usage

aqs_services_by_cbsa(
  parameter,
  bdate,
  edate,
  cbsa_code,
  duration = NA_character_,
  service,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

cbsa_code

a R character object which represents the 5 digit AQS Core Based Statistical Area code (the same as the census code, with leading zeros)

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

service

a string which represents the services provided by the AQS API For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.


aqs_services_by_county

Description

a helper function that abstracts the formatting of the inputs for a call to aqs away from the calling function for aggregations by county then calls the aqs and returns the result. This helper function is not meant to be called directly from external functions.

Usage

aqs_services_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  service,
  duration = NA_character_,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

service

a string which represents the services provided by the AQS API For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.


aqs_services_by_MA

Description

a helper function that abstracts the formatting of the inputs for a call to aqs away from the calling function for aggregations by Monitoring Agency (MA) then calls the aqs and returns the result. This helper function is not meant to be called directly from external functions.

Usage

aqs_services_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  service,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

service

a string which represents the services provided by the AQS API For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.


aqs_services_by_pqao

Description

a helper function that abstracts the formatting of the inputs for a call to aqs away from the calling function for aggregations by Primary Quality Assurance Organization (pqao) then calls the aqs and returns the result. This helper function is not meant to be called directly from external functions.

Usage

aqs_services_by_pqao(
  parameter,
  bdate,
  edate,
  pqao_code,
  service,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

pqao_code

a R character object which represents the 4 digit AQS Primary Quality Assurance Organization code (with leading zeroes).

service

a string which represents the services provided by the AQS API. For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.


aqs_services_by_site

Description

a helper function that abstracts the formatting of the inputs for a call to aqs away from the calling function for aggregations by site then calls the aqs and returns the result. This helper function is not meant to be called directly from external functions.

Usage

aqs_services_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  duration = NA_character_,
  service,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

service

a string which represents the services provided by the AQS API. For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_transactionsample_by_site()


aqs_services_by_state

Description

a helper function that abstracts the formatting of the inputs for a call to aqs away from the calling function for aggregations by State then calls the aqs and returns the result. This helper function is not meant to be called directly from external functions.

Usage

aqs_services_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  duration = NA_character_,
  service,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  AQS_domain = "aqs.epa.gov"
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

duration

an optional R character string that represents the parameter duration code that limits returned data to a specific sample duration. The default value of NA_character_ results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour CO or $O_3$ rolling averages, 3/6 day PM averages or Pb 3 month rolling averages. @seealso aqs_sampledurations() for a list of all available duration codes.

service

a string which represents the services provided by the AQS API. For a list of available services @seealso https://aqs.epa.gov/aqsweb/documents/data_api.html#services

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

AQS_domain

a R string object containing the domain that should be used in constructing the API call.

Value

a AQS_DATAMART_APIv2 S3 object that is the return value from the AQS API. A AQS_DATAMART_APIv2 is a 2 item named list in which the first item ($Header) is a tibble of header information from the AQS API and the second item ($Data) is a tibble of the data returned.


aqs_sign_up

Description

[Stable] Use this service to register as a new user or to reset an existing user's key. A verification email will be sent to the email account specified. To reset a password: If the request is made with an email that is already registered, a new key will be issued for that account and emailed to the listed address. Usage is the same in either case. Refer to the email message for further instructions before continuing.

Usage

aqs_sign_up(email)

Arguments

email

a R character object which represents the email account that will be used to register with the AQS API or change an existing user's key. A verification email will be sent to the account specified. Follow the instructions in the verification e-mail before proceeding to use any other functionality of the AQS API. Register your credential with the @3 aqs_credentials() before using the other functions in this library.

Value

None

Note

The '@' character needs to be escaped with the '/' character.

Examples

# to register a new user or generate a new key with the email
          #  address "John.Doe/@myemail.com"
          ## Not run: aqs_sign_up(email = "John.Doe/@myemail.com")
          #  after calling this function please follow the instructions that
          #  are sent in the verification e-mail before proceeding.

aqs_sites_by_county

Description

[Stable] Returns data containing a table of all air monitoring sites with the input state and county FIPS code combination.

Usage

aqs_sites_by_county(stateFIPS, countycode, return_header = FALSE)

Arguments

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of all air monitoring sites with the requested state and county FIPS codes.

Examples

# Returns an AQS_Data Mart_APIv2 S3 object witch returns all sites
          #  in Hawaii County, HI
          ## Not run: aqs_sites_by_county(stateFIPS = "15",
                                           countycode = "001")
                 
## End(Not run)

aqs_states

Description

[Stable] Returns a table of US states, US territories, and the district or Columbia with their respective FIPS codes.

Usage

aqs_states(return_header = FALSE)

Arguments

return_header

If FALSE (default) only returns data requested. If TRUE returns an AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of states and their associated FIPS codes.

Examples

# Returns a tibble of states and their FIPS codes
          ## Not run: aqs_states()

aqs_transactionsample_by_county

Description

[Stable] Returns transactionsample data - aggregated by county in the AQS Submission Transaction Format (RD) sample (raw) data for a parameter code aggregated by matching input parameter, stateFIPS and countycode provided for bdate - edate time frame. Includes data both in submitted and standard units

Usage

aqs_transactionsample_by_county(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of transaction sample (raw) data in the AQS submission transaction format (RD) corresponding to the inputs provided.

Note

The AQS API only allows for a single year of transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_county functions: aqs_annualsummary_by_county(), aqs_dailysummary_by_county(), aqs_monitors_by_county(), aqs_qa_annualperformanceeval_by_county(), aqs_qa_blanks_by_county(), aqs_qa_collocated_assessments_by_county(), aqs_qa_flowrateaudit_by_county(), aqs_qa_flowrateverification_by_county(), aqs_qa_one_point_qc_by_county(), aqs_qa_pep_audit_by_county(), aqs_quarterlysummary_by_county(), aqs_quarterlysummary_by_site(), aqs_sampledata_by_county()

Examples

## Not run:  #   Returns all FRM/FEM transaction data for
                   #   Wake County, NC between on Feb 28, 2016.
                   aqs_transactionsample_by_county(parameter = "88101",
                                                 bdate = as.Date("20160228",
                                                         format = "%Y%m%d"),
                                                 edate = as.Date("20160228",
                                                          format = "%Y%m%d"),
                                                 stateFIPS = "37",
                                                 countycode = "183"
                                                 )
                 
## End(Not run)

aqs_transactionsample_MA

Description

[Stable] Returns transactionsample data - aggregated by Monitoring agency (MA) in the AQS Submission Transaction Format (RD) sample (raw) data for a parameter code aggregated by matching input parameter, and monitoring agency (MA) code provided for bdate - edate time frame. Includes data both in submitted and standard units

Usage

aqs_transactionsample_by_MA(
  parameter,
  bdate,
  edate,
  MA_code,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

MA_code

a R character object which represents the 4 digit AQS Monitoring Agency code (with leading zeroes).

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of transaction sample (raw) data in the AQS submission transaction format (RD) corresponding to the inputs provided.

Note

The AQS API only allows for a single year of transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_state functions: aqs_qa_annualperformanceeval_by_state(), aqs_qa_annualperformanceevaltransaction_by_state(), aqs_quarterlysummary_by_box(), aqs_quarterlysummary_by_cbsa(), aqs_quarterlysummary_by_state(), aqs_transactionsample_by_state()

Examples

#Returns a tibble of ozone transaction sample data for all monitors
          #operated by South Coast Air Quality Management District collected
          #on May 15, 2015
          ## Not run: aqs_transactionsample_by_MA(parameter = "44201",
                                               bdate = as.Date("20150515",
                                                          format = "%Y%m%d"),
                                               edate = as.Date("20150515",
                                                          format = "%Y%m%d"),
                                               MA_code = "0972"
                                               )
                 
## End(Not run)

aqs_transactionsample_by_site

Description

[Stable] Returns transactionsample data aggregated by site in the AQS Submission Transaction Format (RD) sample (raw) data for a parameter code aggregated by matching input parameter, sitenum, countycode and stateFIPS provided for bdate - edate time frame. Includes data both in submitted and standard units

Usage

aqs_transactionsample_by_site(
  parameter,
  bdate,
  edate,
  stateFIPS,
  countycode,
  sitenum,
  cbdate = NA_Date_,
  cedate = NA_Date_,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

countycode

a R character object which represents the 3 digit state FIPS code for the county being requested (with leading zero(s)). @seealso aqs_counties_by_state() for the list of available county codes for each state.

sitenum

a R character object which represents the 4 digit site number (with leading zeros) within the county and state being requested.

cbdate

a R date object which represents a "beginning date of last change" that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to NA_Date_.

cedate

a R date object which represents an "end date of last change" that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to NA_Date_.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of transaction sample (raw) data in the AQS submission transaction format (RD) corresponding to the inputs provided.

Note

The AQS API only allows for a single year of transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_site functions: aqs_annualsummary_by_site(), aqs_dailysummary_by_site(), aqs_monitors_by_site(), aqs_qa_annualperformanceeval_by_site(), aqs_qa_annualperformanceevaltransaction_by_county(), aqs_qa_annualperformanceevaltransaction_by_site(), aqs_qa_blanks_by_site(), aqs_qa_collocated_assessments_by_site(), aqs_qa_flowrateaudit_by_site(), aqs_qa_flowrateverification_by_site(), aqs_qa_one_point_qc_by_site(), aqs_qa_pep_audit_by_site(), aqs_sampledata_by_site(), aqs_services_by_site()

Examples

#Returns a AQS_Data Mart_APIv2 S3 object of the returns
         ## Not run:  #   returns all ozone transaction data for the
                   #   Millbrook School site (#0014) in Wake County, NC for
                   #   June 18, 2017
                   aqs_transactionsample_by_site(parameter = "44201",
                                                 bdate = as.Date("20170618",
                                                         format = "%Y%m%d"),
                                                 edate = as.Date("20170618",
                                                          format = "%Y%m%d"),
                                                 stateFIPS = "37",
                                                 countycode = "183",
                                                 sitenum = "0014"
                                                 )
                 
## End(Not run)

aqs_transactionsample_by_state

Description

[Stable] Returns transactionsample data - aggregated by state in the AQS Submission Transaction Format (RD) sample (raw) data for a parameter code aggregated by matching input parameter, and stateFIPS provided for bdate - edate time frame. Includes data both in submitted and standard units

Usage

aqs_transactionsample_by_state(
  parameter,
  bdate,
  edate,
  stateFIPS,
  return_header = FALSE
)

Arguments

parameter

a character list or a single character string which represents the parameter code of the air pollutant related to the data being requested.

bdate

a R date object which represents that begin date of the data selection. Only data on or after this date will be returned.

edate

a R date object which represents that end date of the data selection. Only data on or before this date will be returned.

stateFIPS

a R character object which represents the 2 digit state FIPS code (with leading zero) for the state being requested. @seealso aqs_states() for the list of available FIPS codes.

return_header

If FALSE (default) only returns data requested. If TRUE returns a AQSAPI_v2 object which is a two item list that contains header information returned from the API server mostly used for debugging purposes in addition to the data requested.

Value

a tibble or an AQS_Data Mart_APIv2 S3 object of transaction sample (raw) data in the AQS submission transaction format (RD) corresponding to the inputs provided.

Note

The AQS API only allows for a single year of transaction data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).

See Also

Other Aggregate _by_state functions: aqs_qa_annualperformanceeval_by_state(), aqs_qa_annualperformanceevaltransaction_by_state(), aqs_quarterlysummary_by_box(), aqs_quarterlysummary_by_cbsa(), aqs_quarterlysummary_by_state(), aqs_transactionsample_by_MA()

Examples

#Returns a AQS_Data Mart_APIv2 S3 object of
         ## Not run:  # Returns a tibble containing benzene transaction sample
                   # data for North Carolina on May 15, 1995
                   aqs_transactionsample_by_state(parameter = "45201",
                                                 bdate = as.Date("19950515",
                                                         format = "%Y%m%d"),
                                                 edate = as.Date("19950515",
                                                          format = "%Y%m%d"),
                                                 stateFIPS = "37"
                                                 )
                 
## End(Not run)