View source: R/misc.utilities.R
| split_len | R Documentation |
split()-able object by lengthssplit_len() splits an object, such as a list or a data frame,
into subsets with specified lengths.
split_len(x, l)
x |
an object with a |
l |
a vector of lengths of the subsets. |
A list with elements of the same type as x.
x <- 1:10
l <- 1:4
o <- split_len(x, l)
stopifnot(identical(lengths(o), l))
stopifnot(identical(unlist(o), x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.