Generate row indices for partitioning a matrix-like object
Source:R/partition.R
partition_indices.RdGenerate row indices for partitioning a matrix-like object
Details
This function returns indices only and does not hold any data in memory. Intended for use in loops or iterators where partitions are materialised one at a time. The remainder from unequal division is retained as a smaller final partition rather than distributed or discarded.
When n_partitions is used, partition sizes differ by at most one row,
with larger partitions appearing first. When partition_size is used,
all partitions except possibly the last will have exactly
partition_size rows.