R/PurpleAir_createMonitor.R
PurpleAir_createMonitor.RdDownload, parse and enhance hourly timeseries data from PurpleAir
and create an object of class mts_monitor for use with the AirMonitor
package.
PurpleAir_createMonitor(
api_key = NULL,
pas = NULL,
sensor_index = NULL,
parameter = c("pm2.5_atm"),
startdate = NULL,
enddate = NULL,
timezone = "UTC",
verbose = FALSE
)PurpleAir API READ Key. If api_key = NULL, it
will be obtained using getAPIKey("PurpleAir-read").
Previously generated pas object containing sensor_index.
PurpleAir sensor identifier.
Parameter to use for data ("pm2.5_atm")
Desired start time (ISO 8601) or POSIXct.
Desired end time (ISO 8601) or POSIXct.
Olson timezone used to interpret dates.
Logical controlling the generation of warning and error messages.
An AirMonitor package mts_monitor object.
This is a very earily implementation that does not include any QC or correction equations.
# \donttest{
# Fail gracefully if any resources are not available
try({
library(AirSensor2)
initializeMazamaSpatialUtils()
mon <-
PurpleAir_createMonitor(
api_key = PurpleAir_API_READ_KEY,
pas = MY_PAS,
sensor_index = "76545",
startdate = "2023-01-01",
enddate = "2023-01-08",
timezone = "UTC",
verbose = TRUE
)
}, silent = FALSE)
#> Error in PurpleAir_createMonitor(api_key = PurpleAir_API_READ_KEY, pas = MY_PAS, :
#> object 'PurpleAir_API_READ_KEY' not found
# }