int_shift

0th

Percentile

Shift an interval along the timeline

Shifts the start and end dates of an interval up or down the timeline by a specified amount. Note that this may change the exact length of the interval if the interval is shifted by a Period object. Intervals shifted by a Duration or difftime object will retain their exact length in seconds.

Usage
int_shift(int, by)
Arguments
int
An interval object
by
A period or duration object
Value

An interval object

See Also

int_flip, int_start, int_end, int_length

Aliases
  • int_shift
Examples
int <- interval(ymd("2001-01-01"), ymd("2002-01-01"))
# 2001-01-01 UTC--2002-01-01 UTC
int_shift(int, duration(days = 11))
# 2001-01-12 UTC--2002-01-12 UTC
int_shift(int, duration(hours = -1))
# 2000-12-31 23:00:00 UTC--2001-12-31 23:00:00 UTC
Documentation reproduced from package lubridate, version 1.5.6, License: GPL-2

Community examples

Looks like there are no examples yet.