To use this on multiple trips, use a grouped data frame with tidyverse code like data |> group_by(id) |> mutate(whack = rb_whacky_distance(lon, lat))

rb_whacky_distance(lon, lat, miles_max = 6)

Arguments

lon

longitude in decimal degrees

lat

latitude in decimal degrees

miles_max

maximum threshold in miles

Value

a boolean vector, TRUE if point classified as whacky

Details

The function uses traipse::track_distance, which by convention the first value is set to NA missing value, because the difference applies to each sequential pair of locations. Here, these missing values are replaced by zero.

The function is overly liberal in that