Compute circular mean direction and resultant length from a headings data frame
Source:R/circular_plotting.R
compute_circ_mean.RdComputes the circular mean direction and resultant length (R) per group from a headings data frame, typically the output of [derive_headings()]. `mean_dir` in the returned data frame is **always in unit-circle convention** (0 = East, counterclockwise), regardless of the input convention, making it suitable for direct use in [add_circ_mean()].
Arguments
- headings_df
Data frame with a column of heading angles in radians. [derive_headings()] sets `attr(headings_df, "angle_convention")` and `attr(headings_df, "coords")` automatically.
- heading_col
Name of the column containing heading angles. Default `"heading"`.
- colour_col
Optional. Name of a column to group by. One row is returned per group. The same column maps to colour in [add_circ_mean()].