This function calculates the number of chunks to make, and returns head/tail index pairs c(head,tail) in a list list(c(head1,tail1) ... c(headn,tailn)) the maximum length of a chunk is given by the threshold parameter, which should be set according to the size of the data in each row, and the intensity of the calculation.
1 | calculateChunks(len, threshold)
|
1 2 3 4 5 | len <- nrow(mtcars)
chunks <- calculateChunks(len,10)%>%
chunkIndices()
mtcars[chunkIndices[[1]],]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.