lubridate (version 1.5.6)

int_flip: Flip the direction of an interval

Description

Reverses the order of the start date and end date in an interval. The new interval takes place during the same timespan as the original interval, but has the opposite direction.

Usage

int_flip(int)

Arguments

int
An interval object

Value

An interval object

See Also

int_shift, int_start, int_end, int_length

Examples

Run this code
int <- interval(ymd("2001-01-01"), ymd("2002-01-01"))
# 2001-01-01 UTC--2002-01-01 UTC
int_flip(int)
# 2002-01-01 UTC--2001-01-01 UTC

Run the code above in your browser using DataCamp Workspace