Summarises each trajectory's [angular_velocity()] (signed turning rate, counter-clockwise positive) by the chosen statistic.
Arguments
- ts
A `Tracks`.
- stat
`"mean_abs"` (default) the typical turning magnitude; `"mean"` the signed net bias (opposite turns cancel); `"max_abs"` the sharpest turn; `"median_abs"` a robust turning magnitude.
- units
`"radians"` per second (default) or `"degrees"` per second.
- x_col, y_col
Names of the coordinate columns. Default to the `Tracks`'s recorded x/y columns.
Value
A `data.frame` with one row per trajectory: the id column and a numeric `turning` column (`NA` for tracks with fewer than three points).
Examples
head(track_turning(cpunctatus, units = "degrees"))
#> trial_id turning
#> 10_1_1 10_1_1 7.485018
#> 10_10_1 10_10_1 4.021752
#> 10_11_1 10_11_1 6.795136
#> 10_12_1 10_12_1 5.855719
#> 10_13_1 10_13_1 6.088549
#> 10_14_1 10_14_1 2.343546
