Description Usage Arguments Value Examples
This function takes a vector and indices from that vector and splits the vector into a list at the assigned indices. Values at the indices can either be kept or discarded.
1 | make_list_at_index(vec, ind, keep_indices = TRUE)
|
vec |
A vector of any length or class |
ind |
Numeric vector depicting the indices at which to split the list |
keep_indices |
Logical. Return the indices in each element of the list or not |
A list with length equal to that of the lenght of vec
. Each element
contains the values in between the indices including the values at the indices if
keep_indices = TRUE
, the default.
1 2 3 | a <- letters
ind <- grep("a|e|i|o|u", a)
consonants <- make_list_at_index(a, ind, keep_indices = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.