sensor_filterDate: Date filtering for AirSensor objects

Description Usage Arguments Value See Also Examples

View source: R/sensor_filterDate.R

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

1
2
3
4
5
6
7
8
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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()
  

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