sensor_filterDate {AirSensor}R Documentation

Date filtering for AirSensor objects

Description

Subsets an AirSensor object by date.

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

Usage

sensor_filterDate(
  sensor = NULL,
  startdate = NULL,
  enddate = NULL,
  days = NULL,
  weeks = NULL,
  timezone = "America/Los_Angeles"
)

Arguments

sensor

An AirSensor 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 sensor object.

See Also

sensor_filter

sensor_filterMeta

Examples

library(AirSensor)

example_sensor %>% 
  sensor_extractData() %>%
  dplyr::pull("datetime") %>%
  range()
  
example_sensor %>% 
  sensor_filterDate(
    startdate = "2018-08-21", 
    enddate = "2018-08-28",
    timezone = "UTC"
  ) %>%
  sensor_extractData() %>%
  dplyr::pull("datetime") %>%
  range()
  

[Package AirSensor version 1.0.8 Index]