This function chops sequentially off the first encountered whack and then starts again from the beginning.

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

THIS FUNCTION DOES NOT WORK IF THE FIRST DATAPOINT IN THE SEQUENCE IS A WHACKY POINT

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

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