int_shift {lubridate} | R Documentation |
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.
int_shift(int, by)
int |
An interval object |
by |
A period or duration object |
An interval object
int_flip
, int_start
, int_end
,
int_length
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