Loads pre-generated .rda files containing the most recent Clarity data.

If archiveDataDir is defined, data will be loaded from this local archive. Otherwise, data will be loaded from the monitoring data repository maintained by the USFS AirFire team.

The files loaded by this function are updated multiple times an hour and contain data for the previous 10 days.

For data extended more than 10 days into the past, use clarity_loadAnnual().

clarity_loadLatest(
  archiveBaseUrl = paste0("INSERT_BASE_HERE", "sensors/v3/PM2.5"),
  archiveBaseDir = NULL,
  QC_negativeValues = c("zero", "na", "ignore"),
  QC_calibration = c("global PM2.5 v2.1", "all")
)

Arguments

archiveBaseUrl

Base URL for monitoring v2 data files.

archiveBaseDir

Local base directory for monitoring v2 data files.

QC_negativeValues

Type of QC to apply to negative values.

QC_calibration

Clairty calibration category

Value

A mts_monitor object with Clarity data. (A list with meta and data dataframes.)

Note

The QC_calibration argument specifies the calibration/correction algorithm used by Clarity for PM2.5 measurements. See Clarity v2 clibration model It is recommended that users stick with the default calibration: "global PM2.5 v2.1". Specifying "all" will retrieve measurements harvested before the introduction of "global PM2.5 v2.1" and are not directly comparable with more recent measurements.

Disclaimer

Data archives accessed by this function are not maintained by Clarity and are provided with no guarantee of completeness or future maintenance. They may be removed at any time with no warning.

Examples

if (FALSE) { # \dontrun{
library(AirMonitor)

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

clarity_loadLatest() %>%
  monitor_leaflet()

}, silent = FALSE)
} # }