Loads monitoring data for a given time range. Data from AirNow, AIRSIS and WRCC are combined into a single ws_monitor object.

Archival datasets are joined with 'daily' and 'latest' datasets as needed to satisfy the requested date range.

monitor_load(
  startdate = NULL,
  enddate = NULL,
  monitorIDs = NULL,
  parameter = "PM2.5",
  baseUrl = "https://haze.airfire.org/monitoring",
  dataDir = NULL,
  aqsPreference = "airnow"
)

Arguments

startdate

Desired start date (integer or character in ymd[hms] format or POSIXct).

enddate

Desired end date (integer or character in ymd[hms] format or POSIXct).

monitorIDs

Optional vector of monitorIDs.

parameter

Parameter of interest.

baseUrl

Base URL for data files.

dataDir

Local directory containing monitoring data files.

aqsPreference

Preferred data source for AQS data when annual data files are available from both `epa` and `airnow`.

Value

A ws_monitor object with PM2.5 monitoring data.

Note

Joining datasets is a computationally expensive task when many monitors are involved. It is highly recommend that monitorIDs be specified when loading recent data with this function.

See also

Examples

if (FALSE) { # Fail gracefully if any resources are not available try({ ca <- monitor_load(20170601,20171001) %>% monitor_subset(stateCodes='CA') }, silent = FALSE) }