當使用數據(例如,在data.frame)用戶可以控制通過使用如何控制write.table()輸出中的小數位數?
options(digits=3)
和上市這樣的data.frame顯示數字。
ttf.all
當用戶需要在對的Excell數據粘貼這樣
write.table(ttf.all, 'clipboard', sep='\t',row.names=F)
的數字參數被忽略和數字不圓。
見漂亮輸出
> ttf.all
year V1.x.x V1.y.x ratio1 V1.x.y V1.y.y ratioR V1.x.x V1.y.x ratioAL V1.x.y V1.y.y ratioRL
1 2006 227 645 35.2 67 645 10.4 150 645 23.3 53 645 8.22
2 2007 639 1645 38.8 292 1645 17.8 384 1645 23.3 137 1645 8.33
3 2008 1531 3150 48.6 982 3150 31.2 755 3150 24.0 235 3150 7.46
4 2009 1625 3467 46.9 1026 3467 29.6 779 3467 22.5 222 3467 6.40
但是,什麼是Excel(剪貼板)不被圓。如何控制在write.table()
?
使用'round()'... – Andrie
如果我理解正確,round()將必須應用於一組列,而且我必須列舉這些。數字= 3是全局的,不需要列枚舉。所以round()不是一個完美的解決方案。 – userJT