| split_len {statnet.common} | R Documentation |
Split a list or some other split()-able object by lengths
Description
split_len() splits an object, such as a list or a data frame,
into subsets with specified lengths.
Usage
split_len(x, l)
Arguments
x |
an object with a |
l |
a vector of lengths of the subsets. |
Value
A list with elements of the same type as x.
Examples
x <- 1:10
l <- 1:4
o <- split_len(x, l)
stopifnot(identical(lengths(o), l))
stopifnot(identical(unlist(o), x))
[Package statnet.common version 4.13.0 Index]