batch_vec: Split vector into batches

Description Usage Arguments Value See Also Examples

View source: R/batch_vec.R

Description

Split a vector into batches, each no longer than batch_size and creating at least n_cores batches, for use in parallel calculations.

Usage

1
batch_vec(vec, batch_size = NULL, n_cores = 1)

Arguments

vec

A vector to be split into batches

batch_size

Maximum size for each batch

n_cores

Number of compute cores, to be used as a minimum number of batches.

Value

A list of vectors, each no longer than batch_size, and with at least n_cores componenets.

See Also

batch_cols()

Examples

1
2
vec_split <- batch_vec(1:304, 50, 8)
vec_split2 <- batch_vec(1:304, 50)

qtl2 documentation built on Oct. 18, 2021, 1:06 a.m.