powered by
Split a vector into batches, each no longer than batch_size and creating at least n_cores batches, for use in parallel calculations.
batch_size
n_cores
batch_vec(vec, batch_size = NULL, n_cores = 1)
A list of vectors, each no longer than batch_size, and with at least n_cores componenets.
A vector to be split into batches
Maximum size for each batch
Number of compute cores, to be used as a minimum number of batches.
batch_cols()
vec_split <- batch_vec(1:304, 50, 8) vec_split2 <- batch_vec(1:304, 50)
Run the code above in your browser using DataLab