powered by
split()
split_len() splits an object, such as a list or a data frame, into subsets with specified lengths.
split_len()
split_len(x, l)
A list with elements of the same type as x.
x
an object with a split() method.
a vector of lengths of the subsets.
x <- 1:10 l <- 1:4 o <- split_len(x, l) stopifnot(identical(lengths(o), l)) stopifnot(identical(unlist(o), x))
Run the code above in your browser using DataLab