batch_vec {qtl2}R Documentation

Split vector into batches

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

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

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

[Package qtl2 version 0.34 Index]