Skip to contents

Function groups cases into batches.

Usage

get_batches_index(number_rows, batch_size, zero_based = FALSE)

Arguments

number_rows

int representing the number of cases or rows of a matrix or array.

batch_size

int size of a batch.

zero_based

bool If TRUE the indices of the cases within each batch are zero based. One based if FALSE.

Value

Returns a list of batches. Each entry in the list contains a vector of int representing the cases belonging to that batch.