This function work like a pacman, chopping sequentially off the first encountered whack.

rb_whacky_speed(lon, lat, time, kn_max = 25)

Arguments

lon

longitude in decimal degrees

lat

latitude in decimal degrees

time

date-time in POSIXct

kn_max

speed threshold in knots

Value

a boolean vector, TRUE if point classified as whacky

Details

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

The function uses traipse::track_speed, 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.