chunks(1, 100, by=30)
chunks(1, 100, by=30, method="seq")
if (FALSE) {
require(foreach)
m <- 10000
k <- 1000
n <- m*k
message("Four ways to loop from 1 to n. Slowest foreach to fastest chunk is 1700:1
on a dual core notebook with 3GB RAM\n")
z <- 0L;
print(k*system.time({it <- icount(m); foreach (i = it) %do% { z <- i; NULL }}))
z
z <- 0L
print(system.time({i <- 0L; while (i
Run the code above in your browser using DataLab