x <- as.Date("2019-01-01") + 0:5
x
# Last location before a change, last location of `x` is always included
warp_change(x, period = "yday", every = 2, last = TRUE)
# Also include first location
warp_change(x, period = "yday", every = 2, last = TRUE, endpoint = TRUE)
# First location after a change, first location of `x` is always included
warp_change(x, period = "yday", every = 2, last = FALSE)
# Also include last location
warp_change(x, period = "yday", every = 2, last = FALSE, endpoint = TRUE)
Run the code above in your browser using DataLab