No missing values are required as padding, but input data with NA
s will incur an
NA
in the output.
To use this on multiple track ids, use a grouped data frame with tidyverse code like
data %>% group_by(id) %>% mutate(distance = track_distance_to(lon, lat, to_lon, to_lat))