lubridate (version 1.3.2)

int_diff: Extract the intervals within a vector of date-times

Description

int_diff returns the intervals that occur between the elements of a vector of date-times. int_diff is similar to the POSIXt and Date methods of diff, but returns an interval object instead of a difftime object.

Usage

int_diff(times)

Arguments

times
A vector of POSIXct, POSIXlt or Date class date-times

Value

  • An interval object that contains the n-1 intervals between the n date-tiwe in times

Examples

Run this code
dates <- now() + days(1:10)
int_diff(dates)

Run the code above in your browser using DataCamp Workspace