Skip to contents

Assign groups to a vector of degree angles

Usage

assign_degree_groups(degrees, min_degrees = 10, ...)

Arguments

degrees

numeric vector of degree angles, in any order.

min_degrees

numeric value indicating the threshold for grouping values in degrees together.

...

additional arguments are ignored.

Value

data.frame with rows in the same order as input degrees, with column 'group' indicating the group assignment as an integer.

Examples

assign_degree_groups(c(5, 10, 355, 350))
#>   degrees order diff diff_pre diff_post group
#> 1       5     1 -350       10         5     1
#> 2      10     2    5        5       -20     1
#> 3     355     3    5        5        10     1
#> 4     350     4  340      -20         5     1

assign_degree_groups(c(5, 10, 355, 180, 350, 340, 174))
#>   degrees order diff diff_pre diff_post group
#> 1       5     1 -350       10         5     1
#> 2      10     2    5        5       164     1
#> 3     355     3    5        5        10     1
#> 4     180     4    6        6       160     3
#> 5     350     5   10       10         5     1
#> 6     340     6  160      160        10     1
#> 7     174     7  164      164         6     3