View source: R/monitor_trimDate.R
| monitor_trimDate | R Documentation |
Trims the date range of a mts_monitor object to local time date boundaries which are within the range of data. This has the effect of removing partial-day data records at the start and end of the timeseries and is useful when calculating full-day statistics.
By default, multi-day periods of all-missing data at the beginning and end
of the timeseries are removed before trimming to date boundaries. If
trimEmptyDays = FALSE all records are retained except for partial days
beyond the first and after the last date boundary.
Day boundaries are calculated using the specified timezone or, if
NULL, from monitor$meta$timezone.
monitor_trimDate(monitor = NULL, timezone = NULL, trimEmptyDays = TRUE)
monitor |
mts_monitor object. |
timezone |
Olson timezone used to interpret dates. |
trimEmptyDays |
Logical specifying whether to remove days with no data at the beginning and end of the time range. |
A subset of the given mts_monitor object. (A list with
meta and data dataframes.)
library(AirMonitor)
# Non-day boundaries
monitor <-
Camp_Fire %>%
monitor_filterDatetime(
"2018111502",
"2018112206",
timezone = "America/Los_Angeles"
)
monitor %>%
monitor_timeRange(timezone = "America/Los_Angeles")
# Trim to full days only
monitor %>%
monitor_trimDate() %>%
monitor_timeRange(timezone = "America/Los_Angeles")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.