Batch a vector or list into a list of elements with a maximum size
Examples
# ----
batch_it(letters, 6L)
#> [[1]]
#> [1] "a" "b" "c" "d" "e" "f"
#>
#> [[2]]
#> [1] "g" "h" "i" "j" "k" "l"
#>
#> [[3]]
#> [1] "m" "n" "o" "p" "q" "r"
#>
#> [[4]]
#> [1] "s" "t" "u" "v" "w" "x"
#>
#> [[5]]
#> [1] "y" "z"
#>
batch_it(letters, 27L)
#> [[1]]
#> [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
#> [20] "t" "u" "v" "w" "x" "y" "z"
#>