splitBy | R Documentation |
Split a vector by a sequence of length This function will
split the vector x
into length(x)
subvector.
The length of each subvector is given by by
.
splitBy(x, by)
x |
A vector to be splitted |
by |
A vector of length |
a list of subvector
TszKin Julian Chan ctszkin@gmail.com
splitBy((1:10)*10,c(2,2)) splitBy((1:10)*10,c(2,3,4)) ## Not run: expect_equivalent(splitBy((1:10)*10,c(2,2)) , list(c(10,20),c(30,40))) expect_equivalent(splitBy((1:10)*10,c(2,3,4)) , list( c(10,20), c(30,40,50) ,c(60,70,80,90) )) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.