A pre-generated pa_synoptic object will be loaded for the given date. These files are generated each day and provide a record of all currently installed PurpleAir sensors for the day of interest. With default arguments, this function will always load data associated with the most recent pre-generated file -- typically less than one hour old.
The datestamp
can be anything that is understood by
lubrdiate::ymd()
including either of the following recommended
formats:
"YYYYmmdd"
"YYYY-mm-dd"
By default, the host computer's date is used.
The pas object for a specific hour may be loaded by specifying
datestamp = "YYYYmmddHH"
.
pas_load( datestamp = NULL, retries = 30, timezone = "America/Los_Angeles", archival = FALSE, verbose = TRUE )
datestamp | Local date string in valid YYYY-mm-dd format. See description. |
---|---|
retries | Max number of days to go back and try to load if requested date cannot be retrieved. |
timezone | Timezone used to interpret |
archival | Logical specifying whether a version should be loaded that includes sensors that have stopped reporting. |
verbose | Logical controlling the generation of warning and error messages. |
A PurpleAir Synoptic pas object.
# \donttest{ library(AirSensor) setArchiveBaseUrl("http://data.mazamascience.com/PurpleAir/v1") pas <- pas_load() if ( interactive() ) { pas %>% pas_filter(stateCode == "CA") %>% pas_leaflet() } # }