slice | R Documentation |
Given a vector of character timestamps, return a logical vector of a length
equal to the number of time steps in the time series with values TRUE
for
those time steps that fall between the two extreme values of the vector
values, FALSE
otherwise.
slice(x, extremes, rightmost.closed = FALSE)
x |
The |
extremes |
Character vector of timestamps that represent the time period of interest. The extreme values are selected. Badly formatted timestamps are silently dropped. |
rightmost.closed |
Is the right side closed, i.e. included in the
result? Default is |
If bounds were set these will be preserved.
A logical vector with a length equal to the number of time steps in
x
with values TRUE
for those time steps that fall between the extreme
values, FALSE
otherwise.
An attribute 'CFTime' will have the same definition as x
but with offsets
corresponding to the time steps falling between the two extremes. If there
are no values between the extremes, the attribute is NULL
.
t <- CFtime("hours since 2023-01-01 00:00:00", "standard", 0:23)
slice(t, c("2022-12-01", "2023-01-01 03:00"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.