| vec_chop {vctrs} | R Documentation |
vec_chop() provides an efficient method to repeatedly slice a vector. It
captures the pattern of map(indices, vec_slice, x = x).
vec_chop(x, indices = NULL)
x |
A vector |
indices |
A list of index values to slice |
A list of size vec_size(indices) or, if indices == NULL,
vec_size(x).
vec_chop(1:5) vec_chop(1:5, list(1, 1:2)) vec_chop(mtcars, list(1:3, 4:6))