dplyr-cluster {dplyr} | R Documentation |
For parallel operations in do
, dplyr maintains a light-weight
local cluster. Cluster creation is relatively expensive (around a second)
so the cluster is created once and cached for subsequent use.
set_cluster(x) stop_cluster() get_cluster() has_cluster() init_cluster(cores = NA, quiet = FALSE)
On windows, this is a PSOCK cluster, and on linux/mac it's a fork cluster.
If not supplied, the number of cores will be two less than the number of
cores provided by detectCores
.
get_cluster
, set_cluster
and has_cluster
are low
level accessor functions to control the cluster cache. You shouldn't
need to use these unless you want to create your own cluster using another
mechanism. init_cluster
creates and caches a new cluster, and
stop_cluster
shuts it down.