2013-02-23 36 views
9

我可產生具有gridExtra一個表:- [R抑制rownames在網格表

例如:

library(gridExtra) 
    grid.table(head(iris)) 

但這產生rownames柱1:6。 有沒有辦法能夠抑制rownames列,以便它不出現在表中?

謝謝你的幫助。

回答

17

只需添加rows = NULL

grid.table(head(iris), rows = NULL) 

另一種解決方案可以設置show.rownames = FALSE

grid.table(head(iris), show.rownames = FALSE) 

enter image description here

+1

非常感謝您的幫助。 – 2013-02-23 20:59:27