monitor_downloadAnnual: Download annual PM2.5 monitoring data

Description Usage Arguments See Also Examples

View source: R/monitor_downloadAnnual.R

Description

Downloads 'annual' data files into dataDir for later use. Downloaded versions of PWFSL monitoring .RData files allow users to work with the package without access to the internet. Once data are downloaded to dataDir, any of the data loading functions can be called with the dataDir argument to replace internet downloads with local file access.

The recommended directory for PWFSL monitoring data is "~/data/monitoring/RData".

For data during the last 45 days, use monitor_downloadDaily().

For the most recent data, use monitor_downloadLatest().

Currently supported parameters include the following:

  1. PM2.5

Avaialble RData files can be seen at: https://haze.airfire.org/monitoring/latest/RData/

Usage

1
2
3
4
5
6
7
monitor_downloadAnnual(
  year = NULL,
  parameter = "PM2.5",
  baseUrl = "https://haze.airfire.org/monitoring",
  dataDir = "~/Data/monitoring/RData",
  ...
)

Arguments

year

Desired year (integer or character representing YYYY).

parameter

Parameter of interest.

baseUrl

Base URL for data files.

dataDir

Local directory in which to save the data file.

...

Additional arguments passed to download.file.

See Also

monitor_loadDaily

Examples

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

library(PWFSLSmoke)

monitor_loadAnnual(2018) %>%
  monitor_subset(stateCodes = "WA", tlim = c(20180701, 20181001)) %>%
  monitor_timeseriesPlot(style = 'gnats')

}, silent = FALSE)

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