Skip to contents

Pre-generated daily summary files are downloaded from the EPA AQS website and filtered/harmonized as described in the Details.

Usage

get_daily_aqs(
  pollutant = c("pm25", "ozone", "no2"),
  year = as.character(2017:2024)
)

Arguments

pollutant

one of "pm25", "ozone", or "no2"

year

calendar year

Value

data.frame/tibble of pollutant concentrations with site id, lat/lon, and date

Details

For PM2.5 (FRM, non-FRM, and speciation), data is filtered to only observations with a sample duration of "24 HOURS". All pollutants measurements are removed if the observation percent for the sampling period is less than 75. When a pollutant is measured by more than one device on the same day at the same s2 location, the average measurement is returned, ensuring unique measurements for each pollutant-location-day

Note: Historical measurements are subject to change and the EPA AQS website only stores the latest versions. Since this function always downloads the latest data from EPA AQS, that means that it will could different results depending on the date it was run.

Get all the files on the page and the date they were last updated: readr::read_csv("https://aqs.epa.gov/aqsweb/airdata/file_list.csv")

Examples

get_daily_aqs("pm25", "2024")
#> # A tibble: 20,059 × 4
#>    s2               date       pollutant  conc
#>    <s2cell>         <date>     <chr>     <dbl>
#>  1 8c1d2a72306b8c27 2024-01-01 pm25        9.3
#>  2 8c1d2a72306b8c27 2024-01-04 pm25        4.4
#>  3 8c1d2a72306b8c27 2024-01-07 pm25        4.4
#>  4 8c1d2a72306b8c27 2024-01-13 pm25        6.4
#>  5 8c1d2a72306b8c27 2024-01-16 pm25        3.9
#>  6 8c1d2a72306b8c27 2024-01-19 pm25        3.8
#>  7 8c1d2a72306b8c27 2024-01-22 pm25        3.7
#>  8 8c1d2a72306b8c27 2024-01-25 pm25        4  
#>  9 8c1d2a72306b8c27 2024-01-28 pm25        3.2
#> 10 8c1d2a72306b8c27 2024-01-31 pm25        5.3
#> # ℹ 20,049 more rows