Learn R Programming

timetools (version 1.5.2)

duration: Extract duration of a Time object

Description

For Time objects.

Usage

duration(x, ...)

## S3 method for class 'POSIXcti': duration(x, ...)

## S3 method for class 'POSIXctp': duration(x, ...)

Arguments

x
object from which get the duration
...
arguments to or from other methods

Value

  • For time intervals it returns a vector of integers indicating, for each time interval, the duration of the interval in seconds.

    For time periods it returns a vector of integers indicating the duration of each time period using its own time unit. For instance :

    duration(POSIXctp(1:2, c('month', 'year'))) > 1 2

See Also

POSIXcti, POSIXctp