split_into_batches: split x into N batches each of a specific size.

Description Usage Arguments Value Author(s)

Description

split x into N batches each of a specific size.

Usage

1
split_into_batches(x, N = NULL, batch.size = NULL)

Arguments

x

either a numeric vector, or a value specifying the length of the data

N

how many batches

batch.size

if specified, then make the batches batch.size long; if NULL, then the batch.size is determined from x/N.

Value

A list with N entries, each entry being a vector of values from x. If the batch.size is set too high given the length of x and N, then empty batches are not included or returned

Author(s)

Mark Cowley, 9 June 2005


drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.