makeCluster | R Documentation |
Create a cluster of nodes for parallel computation
makeCluster(
numberOfThreads,
singleThreadToMain = TRUE,
setAndromedaTempFolder = TRUE
)
numberOfThreads |
Number of parallel threads. |
singleThreadToMain |
If |
setAndromedaTempFolder |
When TRUE, the andromedaTempFolder option will be copied to each thread. |
An object representing the cluster.
fun <- function(x) {
return (x^2)
}
cluster <- makeCluster(numberOfThreads = 3)
clusterApply(cluster, 1:10, fun)
stopCluster(cluster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.