2011-12-13 58 views

回答

10

tidy.source()在formatR包,選擇keep.comment = FALSE

並舉例....複製並粘貼以下(包括註釋)。整潔的源默認爲閱讀代碼的剪貼板。

# This is a useless comment 
for(i in 1:5){ 
    print(i) 
} 

然後

> library(formatR) 
> tidy.source(keep.comment = FALSE) 
for (i in 1:5) { 
    print(i) 
} 
+0

完美 - 感謝 – 2011-12-13 21:58:34