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.

Examples

library(AirSensor)

example_sensor %>% 
  sensor_extractData() %>%
  dplyr::pull("datetime") %>%
  range()
#> [1] "2022-07-01 00:00:00 UTC" "2022-07-07 23:00:00 UTC"
  
example_sensor %>% 
  sensor_extractData() %>%
  dplyr::pull("datetime") %>%
  range()
#> [1] "2022-07-01 00:00:00 UTC" "2022-07-07 23:00:00 UTC"