track_speed {traipse} | R Documentation |
Track speed
Description
Calculate speed (m/s) based on geodesic distance with longitude, latitude, date-time input vectors. The unit of speed is metres per second.
Usage
track_speed(x, y, date)
Arguments
x |
longitude |
y |
latitude |
date |
date-time in POSIXct |
Details
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(speed = track_speed(lon, lat, date))
Value
numeric vector of sequential distances in metres per second, see Details
Examples
track_speed(trips0$x, trips0$y, trips0$date)[1:10]
[Package traipse version 0.3.0 Index]