Subsets an AirSensor object by date.

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

  • "YYYYmmdd"

  • "YYYY-mm-dd"

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

Examples

library(AirSensor) example_sensor %>% sensor_extractData() %>% dplyr::pull("datetime") %>% range()
#> [1] "2018-08-14 17:00:00 UTC" "2018-09-07 06:00:00 UTC"
example_sensor %>% sensor_filterDate( startdate = "2018-08-21", enddate = "2018-08-28", timezone = "UTC" ) %>% sensor_extractData() %>% dplyr::pull("datetime") %>% range()
#> [1] "2018-08-21 00:00:00 UTC" "2018-08-27 23:00:00 UTC"