filter_index | R Documentation |
This shorthand respects time zones and encourages compact expressions.
filter_index(.data, ..., .preserve = FALSE)
.data |
A tsibble. |
... |
Formulas that specify start and end periods (inclusive), or strings.
|
.preserve |
Relevant when the |
There is a known issue of an extra hour gained for a machine setting time
zone to "Europe/London", regardless of the time zone associated with
the POSIXct inputs. It relates to anytime and Boost. Use Sys.timezone()
to check if the system time zone is "Europe/London". It would be recommended to
change the global environment "TZ" to other equivalent names: GB, GB-Eire,
Europe/Belfast, Europe/Guernsey, Europe/Isle_of_Man and Europe/Jersey as
documented in ?Sys.timezone()
, using Sys.setenv(TZ = "GB")
for example.
time_in for a vector of time index
# from the starting time to the end of Feb, 2015
pedestrian %>%
filter_index(~ "2015-02")
# entire Feb 2015, & from the beginning of Aug 2016 to the end
pedestrian %>%
filter_index("2015-02", "2016-08" ~ .)
# multiple time windows
pedestrian %>%
filter_index(~"2015-02", "2015-08" ~ "2015-09", "2015-12" ~ "2016-02")
# entire 2015
pedestrian %>%
filter_index("2015")
# specific
pedestrian %>%
filter_index("2015-03-23" ~ "2015-10")
pedestrian %>%
filter_index("2015-03-23" ~ "2015-10-31")
pedestrian %>%
filter_index("2015-03-23 10" ~ "2015-10-31 12")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.