Description Usage Arguments Value Functions Examples
A function to quickly create a cluster for use in parallel vector comprehensions.
Use makeCluster
from the parallel
package
for greater control. It defaults to making a PSOCK cluster on Windows systems and
a Fork cluster on unix-based systems. close_cluster
is a wrapper to
stopCluster
.
1 2 3 | auto_cluster(ncore = detectCores() - 1)
close_cluster(clust)
|
ncore |
number of cores/nodes to use. If not specified, it attempts to detect the number of cores available and uses all but 1. |
clust |
cluster to close the connection to |
an object of class c("SOCKcluster", "cluster")
close_cluster
: close an open connection to a cluster
1 2 3 4 | ## Parallel vector comprehension
cluster <- auto_cluster(2)
Num(for (i in 1:1000) exp(sqrt(i)), clust=cluster)
close_cluster(cluster)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.