看板 R_Language 關於我們 聯絡資訊
[問題類型]: 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) [軟體熟悉度]: 使用者(已經有用R 做過不少作品) [問題敘述]: 各位好,目前想將自己所解的程式,運算完後輸出一個summay的檔案 所使用的平行運算套件為Snow套件。 目前所遭遇的問題有兩個,分別敘述如下: 1.在平行運算的時候,想要印出 iterations 的進度 ex. 總共做 10 次運算,印出 1/10,2/10...這樣的輸出掌握運算進度 請問這該如何改寫? 2.在平行運算之後,該如何印出每一次iterations所得到的summary? ex. Iteration 1: A B C Iteration 2: B C D Iteration 3: E G I ################################## 運算結束後 輸出一個Summary File 1.A B C 2.B C D 3.E G I 這樣子的一個檔案 請問該如何改寫? [程式範例]: 在此我提供兩個程式碼 1.寫好的for loop 運算,並未使用平行運算,可以順利輸出summary file & Iteration number Link:http://ideone.com/5AT7l6 2.加入平行運算之後,並未成功輸出 summary file & print out iteration number Link:http://ideone.com/QUIfoF 請各位指導一下該如何改寫,謝謝各位的指導,如果需要任何資訊 請讓我知道 謝謝 [環境敘述]: > R.version _ platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 status major 3 minor 2.3 year 2015 month 12 day 10 svn rev 69752 language R version.string R version 3.2.3 (2015-12-10) nickname Wooden Christmas-Tree [關鍵字]: Data.table,dplry,snow -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.193.239.13 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1463498480.A.F26.html
cywhale: outDF <- rbindlist(parLapply(clus,1:L, function(x, 05/18 01:39
cywhale: dt) {.. dt<-rbindlist(list(dt,..))}, dt=summaryDF)) 05/18 01:43
cywhale: then outDF is your summary output (ps: here function 05/18 01:46
cywhale: is ur clusterfunction, but pass initial summaryDF as 05/18 01:47
cywhale: an argument (So no need to clusterExport it again) 05/18 01:49
h310713: Thanks for you reply, but can you teach me in detail 05/18 13:12
h310713: process ? I tried the way you replied, but didnt wor 05/18 13:12
h310713: k. Error information is : have no object summaryDF. T 05/18 13:12
h310713: hanks 05/18 13:12