make_numeric_indices: Convert indices to numerical indices
Description
Converts (possibly) logical indices to numerical ones.
Also ensures unique indices and sorts them if specified.
Usage
make_numeric_indices(ind, n = NULL, unique = TRUE, sort = TRUE)
Value
A numerical index vector
Arguments
- ind
The numerical or logical index vector
- n
Max numerical index (used if ind
is logical and might be recycled)
- unique
Whether to keep every (numerical) index at most once
- sort
Whether to sort the numerical indices