Skip to content

Instantly share code, notes, and snippets.

@Dulani
Created October 23, 2014 18:16
Show Gist options
  • Save Dulani/b8a9bd7c2a5344e7b47c to your computer and use it in GitHub Desktop.
Save Dulani/b8a9bd7c2a5344e7b47c to your computer and use it in GitHub Desktop.
The parallel back end CPU registration code for doParallel/foreach/dplyr
require(dplyr)
require(parallel)
require(foreach)
require(doParallel)
cpuCount <- detectCores() #From the parallel package
registerDoParallel(cores=cpuCount-1) #Don't take all cores.
dplyr({put dplyr data arguments here},.parallel=T) #Run dplyr in parallel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment