Contents

Parallelization in R

TL;DR

fun <- function(...) {
    # define your function
}

# init
library(future.apply)
plan(multicore, 32)  # on macOS, choose multicore

# run!
future_lapply(iterable, fun)

future may take a little time to ramp up. I’ve seen cases where processing 1,000 items took ~20 s, and processing 5,000 still took ~20 s!