View source: R/pas_filterDate.R
pas_filterDate | R Documentation |
Subsets a pas object by date.
Dates can be anything that is understood by MazamaCoreUtils::parseDatetime()
including either of the following recommended formats:
"YYYYmmdd"
"YYYY-mm-dd"
Timezone determination precedence assumes that if you are passing in
POSIXct
values then you know what you are doing.
get timezone from startdate
if it is POSIXct
use passed in timezone
pas_filterDate(pas = NULL, startdate = NULL, enddate = NULL, timezone = NULL)
pas |
PurpleAir Synoptic pas object. |
startdate |
Desired start datetime (ISO 8601). |
enddate |
Desired end datetime (ISO 8601). |
timezone |
Optional Olson timezone used to interpret dates. |
The incoming pas
object must contain the date_created
and
last_modified
fields. The returned pas object will retain sites
where startdate <= last_seen && enddate >= pas$date_created
.
pas_filter
library(AirSensor2)
august_2018 <-
example_pas_historical %>%
pas_filterDate(
startdate = 20180701,
enddate = 20181101,
timezone = "America/Los_Angeles"
)
fields <- c("sensor_index", "name", "date_created", "last_seen")
head(august_2018[,fields])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.