sts_trimDate | R Documentation |
Trims the date range of a sts 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.
Day boundaries are calculated using the specified timezone
or, if
NULL
, from sts$meta$timezone
.
sts_trimDate(sts = NULL, timezone = NULL)
sts |
SingleTimeSeries sts object. |
timezone |
Olson timezone used to interpret dates. |
A subset of the incoming sts time series object.
(A list with meta
and data
dataframes.)
library(MazamaTimeSeries)
UTC_week <- sts_filterDate(
example_sts,
startdate = 20180808,
enddate = 20180815,
timezone = "UTC"
)
# UTC day boundaries
head(UTC_week$data)
# Trim to local time day boundaries
local_week <- sts_trimDate(UTC_week)
head(local_week$data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.