split_size | R Documentation |
n
In contrast to desiderata::assign_groups()
which splits a vector into n
chunks (possibly with a different number of entries per chunk),
desiderata::split_size()
splits a vector into an arbitrary number of chunks
as long as each chunk has n
or fewer entries inside it.
split_size(vec, size)
vec |
(Vector) Any vector. |
size |
(Integer) The number of entries per chunk. |
A list of dynamic length, where each entry is a chunk from vec
of
length 1 up to size
.
https://stackoverflow.com/a/3321659/5578429
split_size(letters, 5)
## $`1`
## [1] "a" "b" "c" "d" "e"
##
## $`2`
## [1] "f" "g" "h" "i" "j"
##
## $`3`
## [1] "k" "l" "m" "n" "o"
##
## $`4`
## [1] "p" "q" "r" "s" "t"
##
## $`5`
## [1] "u" "v" "w" "x" "y"
##
## $`6`
## [1] "z"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.