chunk_vector {oeli} | R Documentation |
This function either
splits a vector into n
chunks of equal size (type = 1
),
splits a vector into chunks of size n
(type = 2
).
chunk_vector(x, n, type = 1, strict = FALSE)
x |
A |
n |
An |
type |
Either |
strict |
Set to |
A list
.
x <- 1:12
chunk_vector(x, n = 3, type = 1)
chunk_vector(x, n = 3, type = 2)
try(chunk_vector(x, n = 5, strict = TRUE))