pat_filterDatetime {AirSensor}R Documentation

Datetime filtering for PurpleAir Timeseries objects

Description

Subsets a PurpleAir Timeseries object by datetime. This function allows for sub-day filtering as opposed to pat_filterDate() which always filters to day-boundaries.

Datetimes can be anything that is understood by MazamaCoreUtils::parseDatetime(). For non-POSIXct values, the recommended format is "YYYY-mm-dd HH:MM:SS".

Timezone determination precedence assumes that if you are passing in POSIXct times then you know what you are doing.

  1. get timezone from startdate if it is POSIXct

  2. use passed in timezone

  3. get timezone from pat

Usage

pat_filterDatetime(
  pat = NULL,
  startdate = NULL,
  enddate = NULL,
  timezone = NULL
)

Arguments

pat

PurpleAir Timeseries pat object.

startdate

Desired start datetime (ISO 8601) or POSIXct.

enddate

Desired end datetime (ISO 8601) or POSIXct.

timezone

Olson timezone used to interpret dates.

Value

A subset of the given pat object.

See Also

pat_filter

pat_filterDate

Examples

library(AirSensor)

example_pat %>%
  pat_filterDatetime(
    startdate = "2018-08-08 06:00:00", 
    enddate = "2018-08-14 18:00:00"
  ) %>%
  pat_multiPlot()


[Package AirSensor version 1.0.8 Index]