monitor_downloadLatest: Download recent PM2.5 monitoring data

View source: R/monitor_downloadLatest.R

monitor_downloadLatestR Documentation

Download recent PM2.5 monitoring data

Description

Downloads 'latest' 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 daily updates covering the most recent 45 days, use monitor_downloadDaily().

For data extended more than 45 days into the past, use monitor_downloadAnnual().

Currently supported parameters include the following:

  1. PM2.5

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

Usage

monitor_downloadLatest(
  parameter = "PM2.5",
  baseUrl = "https://haze.airfire.org/monitoring/latest/RData/",
  dataDir = "~/Data/monitoring/RData",
  ...
)

Arguments

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


# Fail gracefully if any resources are not available
try({

library(PWFSLSmoke)

monitor_loadLatest() %>%
  monitor_subset(stateCodes=CONUS) %>%
  monitor_map()

}, silent = FALSE)


MazamaScience/PWFSLSmoke documentation built on July 3, 2023, 11:03 a.m.