Skip to contents

Real elapsed time of each point from its own track's start, computed on demand from the time column and (for frame-indexed time) the [frame_rate()]. POSIXct time is used directly, and so is numeric time loaded as seconds (`read_tracks(time_type = "seconds")`, or a duration column): a frame rate is neither needed nor applied to it. Any other numeric time is a frame index and requires a frame rate.

Usage

elapsed_seconds(ts, units = c("seconds", "minutes", "milliseconds"))

Arguments

ts

A [Tracks] object.

units

`"seconds"` (default), `"minutes"`, or `"milliseconds"`.

Value

A numeric vector aligned to the object's observations.

See also

[frame_rate()], [track_duration()]

Examples

head(elapsed_seconds(cpunctatus))
#> [1]  0  5 10 15 20 25