It's difficult to get a simple speed definition yet robust to all kinds of dirty data cases. A sophisticated method is attempt first which should cover most common edge cases reasonably well. When it fails for extreme situations, the function will fall back to simpler method which is more naive but robust.

assign_speed(animals_dt, tele_list, device_error = 10)

Arguments

animals_dt

location data.table from combine(). The original input data.table will be modified in place by reference after calculation.

tele_list

the ctmm::as.telemetry() telemetry obj list. Calculation need error information from it.

device_error

standardized device error in meter. Example: GPS: 10, VHF: 100

Value

The input data.table with assigned_speed columns added. The name assign hint on this nature.

Details

To reduce duplicate calculation, speed calculation will use some columns created in distance calculation. Always update data.table with assign_distance() first then use assign_speed().