pas_load {AirSensor}R Documentation

Load PurpleAir synoptic data

Description

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:

By default, the host computer's date is used.

The pas object for a specific hour may be loaded by specifying datestamp = "YYYYmmddHH".

Usage

pas_load(
  datestamp = NULL,
  retries = 30,
  timezone = "America/Los_Angeles",
  archival = FALSE,
  verbose = TRUE
)

Arguments

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 datestamp.

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.

Value

A PurpleAir Synoptic pas object.

See Also

pas_createNew

Examples


library(AirSensor)

setArchiveBaseUrl("http://data.mazamascience.com/PurpleAir/v1")

pas <- pas_load()

if ( interactive() ) {
  pas %>% 
    pas_filter(stateCode == "CA") %>%
    pas_leaflet()
}
 

[Package AirSensor version 1.0.8 Index]