A pre-generated airsensor object will be loaded containing data for the most recent 7 or 45-day interval.

Each airsensor object contains data from a named collection of PurpleAir sensors.

sensor_loadLatest(collection = "scaqmd", days = 7)

Arguments

collection

Name associated with the collection.

days

Number of days of data to include (7 or 45).

Value

An object of class "pa_timeseries".

Examples

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

library(AirSensor)

setArchiveBaseUrl("https://airsensor.aqmd.gov/PurpleAir/v1")

sensor_loadLatest("scaqmd") %>%
  PWFSLSmoke::monitor_timeseriesPlot(style = 'gnats')

}, silent = FALSE)
#> ERROR [2023-04-03 16:31:32] data file could not be loaded from: https://airsensor.aqmd.gov/PurpleAir/v1/airsensor/latest/airsensor_scaqmd_latest7.rda
#> Error : Data file could not be loaded from: https://airsensor.aqmd.gov/PurpleAir/v1
# }