R package snow

This package is for Simple Network of Workstations (SNOW). Let's take a look at a program associated with destruction:

library(snow) 
cl <- makeSOCKcluster(c("localhost","localhost")) 
clusterApply(cl, 1:2, get("+"), 3) 
clusterEvalQ(cl, library(boot)) 
x<-1 
clusterExport(cl, "x") 
clusterCall(cl, function(y) x + y, 2) 

The makeSOCKcluster() function is used to start and stop a snow cluster and to set default cluster options. The clusterApply() calls the function on the first cluster node with arguments seq[[1]] and ..., on the second node with seq[[2]] and ..., and so on. If the length of seq is greater than the number of nodes in the cluster, then cluster nodes are recycled. A list of the results is returned; the length of the ...

Get Hands-On Data Science with Anaconda now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.