View source: R/pat_createNew.R
pat_createNew | R Documentation |
Cerate a pat
object for a specific sensor_index
.
pat_createNew(
api_key = NULL,
pas = NULL,
sensor_index = NULL,
startdate = NULL,
enddate = NULL,
timezone = "UTC",
average = 0,
baseUrl = "https://api.purpleair.com/v1/sensors",
verbose = FALSE
)
api_key |
PurpleAir API Read Key. If |
pas |
Previously generated pas object containing |
sensor_index |
PurpleAir sensor unique identifier. |
startdate |
Desired start time (ISO 8601) or |
enddate |
Desired end time (ISO 8601) or |
timezone |
Olson timezone used to interpret dates. |
average |
Temporal averaging in minutes performed by PurpleAir. One of: 0 (raw), 10, 30, 60 (hour), 360, 1440 (day). |
baseUrl |
Base URL for the PurpleAir API. |
verbose |
Logical controlling the generation of warning and error messages. |
A PurpleAir Timeseries pat object.
# Fail gracefully if any resources are not available
try({
library(AirSensor)
pat <-
pat_createNew(
api_key = PURPLE_AIR_API_READ_KEY,
pas = example_pas,
sensor_index = "3515",
startdate = "2022-07-01",
enddate = "2022-07-08",
timezone = "UTC",
verbose = TRUE
)
View(pat$meta[1:100,])
}, silent = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.