track_time | R Documentation |
Calculate time duration based on sequential difference of date-time input. The unit of time duration is seconds.
track_time(date)
date |
date-time in POSIXct |
By convention the first value is set to NA
missing value, because the
difference applies to each sequential pair of locations.
To use this on multiple track ids, use a grouped data frame with tidyverse
code like data %>% group_by(id) %>% mutate(duration = track_time(date))
numeric vector of duration between sequential date-time values in seconds, see Details
track_time(trips0$date)[1:10]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.