[問題] snow 結束運算輸出Summary File

看板R_Language作者 (虎虎虎)時間8年前 (2016/05/17 23:21), 編輯推噓1(108)
留言9則, 2人參與, 最新討論串1/1
[問題類型]: 程式諮詢(我想用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

05/18 01:39, , 1F
outDF <- rbindlist(parLapply(clus,1:L, function(x,
05/18 01:39, 1F

05/18 01:43, , 2F
dt) {.. dt<-rbindlist(list(dt,..))}, dt=summaryDF))
05/18 01:43, 2F

05/18 01:46, , 3F
then outDF is your summary output (ps: here function
05/18 01:46, 3F

05/18 01:47, , 4F
is ur clusterfunction, but pass initial summaryDF as
05/18 01:47, 4F

05/18 01:49, , 5F
an argument (So no need to clusterExport it again)
05/18 01:49, 5F

05/18 13:12, , 6F
Thanks for you reply, but can you teach me in detail
05/18 13:12, 6F

05/18 13:12, , 7F
process ? I tried the way you replied, but didnt wor
05/18 13:12, 7F

05/18 13:12, , 8F
k. Error information is : have no object summaryDF. T
05/18 13:12, 8F

05/18 13:12, , 9F
hanks
05/18 13:12, 9F
文章代碼(AID): #1NEpRmyc (R_Language)