splitIdx: Get a list of indices to split up a vector for parallel...

Description Usage Arguments Value Examples

Description

Create a list of indices to split up a vector n into chunks with a length of at most maxn.

Usage

1
splitIdx(n, maxn = 1000)

Arguments

n

Length of the vector to be split up.

maxn

The maximum size (number of records) of each chunk.

Value

A list, each element containing a vector of lenngth two giving the start and end indices for a chunk.

Examples

1
2
3
4
idx <- splitIdx(n = 26, maxn = 3)

# use lapply on index to plot corresponding letters
lapply(idx, function(idx) letters[idx[1]:idx[2]])

SEEG-Oxford/seegSDM documentation built on May 9, 2019, 11:08 a.m.