This function maps indices from an input vector to corresponding sequences of
grouped indices. Each element from the input specifies a group to be mapped
from the sequence, determined by the grouping size n.
Usage
map_indices(indices, n)
Value
An integer
vector, containing the mapped indices according to the
specified group size.
Arguments
indices
[integer()]
An index vector, where each element specifies a group to be mapped from the
sequence.
n
[integer]
The size of each group of consecutive indices.
Details
This function is useful when working with indices arranged in fixed-size
groups, where each group can be referenced by a single index. For example, if
indices are structured in chunks of 3, calling this function with n = 3
will map the corresponding groups of 3 consecutive indices for the given
input indices, see the examples.