l <- iteror(letters, chunkSize=7)
as.list(l)
a <- array(1:8, c(2, 2, 2))
# iterate over all the slices
it <- iteror(a, by=3)
as.list(it)
# iterate over all the columns of each slice
it <- iteror(a, by=c(2, 3))
as.list(it)
# iterate over all the rows of each slice
it <- iteror(a, by=c(1, 3))
as.list(it)
Run the code above in your browser using DataLab