R抑制网格表中的rownames

时间:2021-04-28 22:59:53

I can produce a table with gridExtra:

我可以使用gridExtra生成一个表:

eg:

例如:

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

But this produces a rownames column 1:6. Is there a way to be able to suppress the rownames column so that it does not appear in the table?

但这会产生一个rownames列1:6。有没有办法能够抑制rownames列,以便它不会出现在表中?

Thank you for your help.

感谢您的帮助。

1 个解决方案

#1


18  

Just add rows = NULL:

只需添加rows = NULL:

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

Another solution could be setting show.rownames = FALSE

另一个解决方案是设置show.rownames = FALSE

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

R抑制网格表中的rownames

#1


18  

Just add rows = NULL:

只需添加rows = NULL:

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

Another solution could be setting show.rownames = FALSE

另一个解决方案是设置show.rownames = FALSE

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

R抑制网格表中的rownames