Skip to contents

Get the index of each block in a list.

Usage

block_index(list_labels)

Arguments

list_labels

Position labels that define the blocks.

Value

Block index of each position.

Examples

list_labels <- list(2, 2, 3, 3, 3, 1, 1)
block_index(list_labels)
#> [1] 1 1 2 2 2 3 3