r - Simple working example of ddply() in parallel on Windows -


i've been searching around simple working example of using ddply() in parallel. i've installed "foreach" package, when call ddply( .parallel = true) warning "no parallel backend registered")

can provide simple working example of using ddply in parallel?

here's simple working example:

> df <- data.frame(val=1:10, ind=c(rep(2, 5), rep(3, 5))) > library(dosnow) > registerdosnow(makecluster(2, type = "sock")) > system.time(print(ddply(df, .(ind), function(x) { sys.sleep(2); sum(x) }, .parallel=false)))   ind v1 1   2 25 2   3 55    user  system elapsed     0.00    0.00    4.01  > system.time(print(ddply(df, .(ind), function(x) { sys.sleep(2); sum(x) }, .parallel=true)))   ind v1 1   2 25 2   3 55    user  system elapsed     0.02    0.00    2.02  

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -