View source: R/transforms_time.R
elapsed.time | R Documentation |
Compute elapsed time from beginning of POSIX vector
elapsed.time(x, units = "hours")
x |
A vector of date/times POSIX objects |
units |
The output units for the time difference |
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.
The time difference for each member of x from the first member of x.
x = Sys.time() + c(0:10)*3600
as.numeric(elapsed.time(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.