pat_filterDate: Date filtering for PurpleAir Timeseries objects

Description Usage Arguments Value Note See Also Examples

View source: R/pat_filterDate.R

Description

Subsets a PurpleAir Timeseries object by date. This function always filters to day-boundaries. For sub-day filtering, use pat_filterDatetime().

Dates can be anything that is understood by lubridate::ymd() including either of the following recommended formats:

Usage

1
2
3
4
5
6
7
8
pat_filterDate(
  pat = NULL,
  startdate = NULL,
  enddate = NULL,
  days = NULL,
  weeks = NULL,
  timezone = NULL
)

Arguments

pat

PurpleAir Timeseries pat object.

startdate

Desired start datetime (ISO 8601).

enddate

Desired end datetime (ISO 8601).

days

Number of days to include in the filterDate interval.

weeks

Number of weeks to include in the filterDate interval.

timezone

Olson timezone used to interpret dates.

Value

A subset of the given pat object.

Note

The returned data will run from the beginning of startdate until the beginning of enddatei.e. no values associated with enddate will be returned. The exception being when enddate is less than 24 hours after startdate. In that case, a single day is returned.

See Also

pat_filter

pat_filterDatetime

Examples

1
2
3
4
5
library(AirSensor)

example_pat %>%
  pat_filterDate(startdate = 20180808, enddate = 20180815) %>%
  pat_multiPlot()

AirSensor documentation built on March 13, 2021, 1:07 a.m.