Split a vector into the chunks
Examples
x <- 1:10
names(x) <- letters[1:10]
tochunks(x, nchunks = 3)
#> $`1`
#> a b c d
#> 1 2 3 4
#>
#> $`2`
#> e f g
#> 5 6 7
#>
#> $`3`
#> h i j
#> 8 9 10
#>
Split a vector into the chunks
x <- 1:10
names(x) <- letters[1:10]
tochunks(x, nchunks = 3)
#> $`1`
#> a b c d
#> 1 2 3 4
#>
#> $`2`
#> e f g
#> 5 6 7
#>
#> $`3`
#> h i j
#> 8 9 10
#>