Divides an sf object (grid
) into a list of chunks, either based on a
specified number of batches (batch_num
) or a maximum chunk size
(batch_size
).
get_batch(grid, batch_size = NULL, batch_num = NULL)
(list) A list of sf objects (chunks).
[mandatory] (sf) The sf object to be split into chunks.
[optional] (integer) Maximum rows per chunk. Must be
set if batch_num
is NULL.
[optional] (integer) Total number of chunks to create.
Must be set if batch_size
is NULL.