Spread angles to minimum degrees difference
Usage
spread_degrees(
degrees,
min_degrees = 10,
iteration = 1,
max_iterations = 20,
verbose = FALSE,
...
)
Details
The function takes a vector of angles in degrees, and
adjusts any angles with adjacent angle below a minimum
angle min_degrees
until the minimum angle is min_degrees
.
If all input angles fit this criteria, it is returned
unchanged, otherwise it will adjust angles then
iteratively call itself until the condition is met.
If all angles are less the min_degrees
degrees from
the nearest adjacent angle, then all angles are equally
spaced around 360 degrees.
See also
Other venndir spatial:
degrees_to_adj()
,
diff_degrees()
,
display_angles()
,
mean_degree_arc()
,
mean_degrees()
,
rescale_coordinates()
Examples
degrees <- c(5, 10, 15, 100, 105, 110, 200, 300, 358);
degrees
#> [1] 5 10 15 100 105 110 200 300 358
spread_degrees(degrees);
#> [1] 2 12 22 95 105 115 200 300 -8
degrees2 <- sample(degrees);
degrees2
#> [1] 200 15 358 110 10 300 5 100 105
spread_degrees(degrees2);
#> [1] 200 22 -8 115 12 300 2 95 105