Learn R Programming

AirSensor (version 1.0.2)

pat_load: Load PurpleAir time series data for a time period

Description

A pre-generated PurpleAir Timeseries pat object will be loaded for the given time interval if available. Data are loaded from the archive set with either setArchiveBaseUrl() or setArchiveBaseDir() for locally archived files.

Dates can be anything that is understood by MazamaCoreUtils::parseDatetime() including any of the following recommended formats:

  • "YYYYmmdd"

  • "YYYY-mm-dd"

  • "YYYY-mm-dd HH:MM:SS"

Usage

pat_load(
  id = NULL,
  label = NULL,
  pas = NULL,
  startdate = NULL,
  enddate = NULL,
  timezone = "America/Los_Angeles"
)

Arguments

id

PurpleAir sensor 'deviceDeploymentID'.

label

PurpleAir sensor 'label'.

pas

PurpleAir Synoptic pas object.

startdate

Desired start time (ISO 8601) or POSIXct.

enddate

Desired end time (ISO 8601) or POSIXct.

timezone

Timezone used to interpret start and end dates.

Value

A PurpleAir Timeseries pat object.

See Also

pat_loadLatest

pat_loadMonth

pat_createNew

Examples

Run this code
# NOT RUN {
library(AirSensor)

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

# Reference an older 'pas' before this sensor was dropped
pas <- pas_load(20190901, archival = TRUE)

pat <- pat_load(
  label = "SCNP_20", 
  pas = pas,
  startdate = 20190411, 
  enddate = 20190521
)

pat_multiPlot(pat)
# }

Run the code above in your browser using DataLab