增加 tableGrob 列标题大小和单元格大小

KRS*_*tam 4 r gridextra grob

有没有办法增加tableGrob项目中列名的单元格?

library(grid)
d <- head(iris, 3)
g <- tableGrob(d)
grid.newpage()
grid.draw(g)
Run Code Online (Sandbox Code Playgroud)

默认:

在此处输入图片说明

我想要实现的目标(这是在 photoshop 中完成的): 在此处输入图片说明

任何帮助深表感谢。

use*_*650 5

您可以通过改变这样做paddingcolhead范围内的theme

例如

thm <- ttheme_default(colhead = 
             # first unit is the wdith, and second the height
             list(padding=unit.c(unit(4, "mm"), unit(10, "mm"))))


tableGrob(d, theme=thm)
Run Code Online (Sandbox Code Playgroud)

要了解您可以更改的内容,您可以ttheme_default()在终端中查看