作者h310713 (虎虎虎)
看板R_Language
标题[问题] snow 结束运算输出Summary File
时间Tue May 17 23:21:16 2016
[问题类型]:
程式谘询(我想用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://webptt.com/cn.aspx?n=bbs/R_Language/M.1463498480.A.F26.html
1F:推 cywhale: outDF <- rbindlist(parLapply(clus,1:L, function(x, 05/18 01:39
2F:→ cywhale: dt) {.. dt<-rbindlist(list(dt,..))}, dt=summaryDF)) 05/18 01:43
3F:→ cywhale: then outDF is your summary output (ps: here function 05/18 01:46
4F:→ cywhale: is ur clusterfunction, but pass initial summaryDF as 05/18 01:47
5F:→ cywhale: an argument (So no need to clusterExport it again) 05/18 01:49
6F:→ h310713: Thanks for you reply, but can you teach me in detail 05/18 13:12
7F:→ h310713: process ? I tried the way you replied, but didnt wor 05/18 13:12
8F:→ h310713: k. Error information is : have no object summaryDF. T 05/18 13:12
9F:→ h310713: hanks 05/18 13:12