elapsed.time: Compute elapsed time from beginning of POSIX vector

View source: R/transforms_time.R

elapsed.timeR Documentation

Compute elapsed time from beginning of POSIX vector

Description

Compute elapsed time from beginning of POSIX vector

Usage

elapsed.time(x, units = "hours")

Arguments

x

A vector of date/times POSIX objects

units

The output units for the time difference

Details

The first member of x will have an elapsed time of 0. Units can be specified as per difftime. Times are not sorted here, so if they are not in order, or at least having the minimum value first, they should be sorted beforehand.

Value

The time difference for each member of x from the first member of x.

Examples

x = Sys.time() + c(0:10)*3600
as.numeric(elapsed.time(x))


qPharmetra/PMDatR documentation built on April 7, 2024, 5:42 p.m.