mean_degree_arc: Mean arc angle in degrees

mean_degree_arcR Documentation

Mean arc angle in degrees

Description

Mean arc angle in degrees

Usage

mean_degree_arc(x, use_range = FALSE, use_median = FALSE, do_plot = FALSE, ...)

Arguments

x

numeric vector of angles in degrees.

use_range

logical indicating whether to return the mean degree angle across the range, which therefore only uses the first and last angular values.

use_median

logical indicating whether to use median() instead of mean(), included here for convenience.

...

additional arguments are ignored.

Details

This function differs from mean_degrees() in that it finds the mean angle in degrees from angles along an arc, guaranteeing that the mean angle is along that numeric arc. It is intended that the arc does not cover more than 360 degrees, and for angles whose numeric values are increasing.

See Also

Other venndir spatial: degrees_to_adj(), diff_degrees(), display_angles(), mean_degrees(), rescale_coordinates(), spread_degrees()

Examples

set.seed(1);
steps <- sample((1:12)^1.5, size=14, replace=TRUE);
steps <- sort(steps);
x <- cumsum(steps);
x;

opar <- par("mfrow"=c(2, 3));
on.exit(par(opar));
mean_degree_arc(x, do_plot=TRUE);
mean_degree_arc(x, use_median=TRUE, do_plot=TRUE);
mean_degree_arc(x, use_range=TRUE, do_plot=TRUE);

x <- x + 235;
mean_degree_arc(x, do_plot=TRUE);
mean_degree_arc(x, use_median=TRUE, do_plot=TRUE);
mean_degree_arc(x, use_range=TRUE, do_plot=TRUE);


jmw86069/venndir documentation built on Nov. 14, 2024, 10:12 a.m.