Group Indices
group_indices.RdReturns a list of indices for each level of a grouped data frame.
Examples
#----------------------------------------------------------------------------
# group_indices() examples
#----------------------------------------------------------------------------
group_indices(mtcars, "cyl")
#> $`4`
#> [1] 3 8 9 18 19 20 21 26 27 28 32
#>
#> $`6`
#> [1] 1 2 4 6 10 11 30
#>
#> $`8`
#> [1] 5 7 12 13 14 15 16 17 22 23 24 25 29 31
#>
group_indices(mtcars, c("cyl", "carb"))
#> $`4|1`
#> [1] 3 18 20 21 26
#>
#> $`4|2`
#> [1] 8 9 19 27 28 32
#>
#> $`6|1`
#> [1] 4 6
#>
#> $`6|4`
#> [1] 1 2 10 11
#>
#> $`6|6`
#> [1] 30
#>
#> $`8|2`
#> [1] 5 22 23 25
#>
#> $`8|3`
#> [1] 12 13 14
#>
#> $`8|4`
#> [1] 7 15 16 17 24 29
#>
#> $`8|8`
#> [1] 31
#>