lubridate (version 1.5.0)

int_standardize: Ensures all intervals in an interval object are positive

Description

If an interval is not positive, int_standardize flips it so that it retains its endpoints but becomes positive.

Usage

int_standardize(int)

Arguments

int
an Interval object

Examples

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

Run the code above in your browser using DataCamp Workspace