For example index_sep('a_b_c', 2, '_')
equals 'b'
.
For example index_sep('a_b_c', c(1, 3), '_')
equals 'a_c'
.
For example index_sep('a_b_c', -2, '_')
equals 'a_c'
.
For example index_sep('a_b_c', 4, '_')
equals ''
.
For example index_sep('a', 1, '_')
equals 'a'
.
For example index_sep('a', 2, '_')
equals ''
.
For example index_sep(c('a_b', 'c'), 2, '_')
equals c('b', '')
.
For example index_sep('a_b_c', c(3, 1), '_')
equals 'c_a'
.
index_sep(x, i, sep = "_", complement = FALSE)
character vector
integer vector without sign mixing
length-one character vector
if TRUE
the indices in i
that are not
matched are returned