monitor_load: Load PM2.5 monitoring data

Description Usage Arguments Value Note See Also Examples

View source: R/monitor_load.R

Description

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.

Usage

1
2
3
4
5
6
7
8
9
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

loadDaily

loadLatest

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Fail gracefully if any resources are not available
try({

ca <- monitor_load(20170601,20171001) %>% monitor_subset(stateCodes='CA')

}, silent = FALSE)

## End(Not run)

PWFSLSmoke documentation built on Nov. 23, 2021, 5:06 p.m.