我在尝试R代码与雪包。 我有功能使用clusterApply在雪包?
小鬼<功能全(X,Y)
我如何使用clusterApply这个功能吗?
cl <- makeCluster(c("localhost","localhost"), type = "SOCK")
clusterApply(cl, 1:6, get("+"), 3)
stopCluster(cl)
,而不是这个,我想用我的功能
cl <- makeCluster(c("localhost","localhost"), type = "SOCK")
clusterApply(cl, imp(dataset,3), 3)
stopCluster(cl)
想这是我的功能我如何能在使用此功能并行和分布式系统运行..
impap<-function(x,y)
{
data<-as(x,"matrix")
t<-data+y
print(t)
}
你试图在多台机器上运行它还是在同一台机器的多个内核上并行运行? –
多台机器.. – vct
@LucasFortini我认为makecluster部分会改变,当我使用多台机器..我对吗? – vct