Compute a circular interval arc from heading angles
Source:R/circular_plotting.R
compute_circ_interval.RdReturns a data frame of arc bounds centred on the circular mean direction. Two built-in statistics are available: a bootstrap confidence interval for the mean direction (`"bootstrap_ci"`, via [circular::mle.vonmises.bootstrap.ci()]) and +/-1 circular SD (`"sd"`, via [circular::sd.circular()]). The `lower` and `upper` columns of the output can be replaced with Bayesian credible interval bounds from any model before passing to [add_circ_interval()].
Usage
compute_circ_interval(
headings_df,
heading_col = "heading",
colour_col = NULL,
stat = c("bootstrap_ci", "sd"),
boot_reps = 1000L,
boot_alpha = 0.05
)Arguments
- headings_df
Data frame containing heading angles.
- heading_col
Name of the heading column (radians). Default `"heading"`.
- colour_col
Optional grouping column. When set, one row is returned per group and the column is preserved in the output.
- stat
Statistic: `"bootstrap_ci"` (default) or `"sd"`.
- boot_reps
Integer. Bootstrap replicates for `stat = "bootstrap_ci"`. Default `1000L`. Ignored when `stat = "sd"`.
- boot_alpha
Significance level for the bootstrap CI. Default `0.05` produces a 95% interval.