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

4
有没有办法在tableGrob项目中增加列名的单元格大小?
library(grid)
d <- head(iris, 3)
g <- tableGrob(d)
grid.newpage()
grid.draw(g)

默认情况:

在此输入图像描述

我想要实现的效果(这是用Photoshop完成的): 在此输入图像描述

非常感谢任何帮助。

1个回答

5
你可以通过改变 themecolheadpadding 来实现此操作。
例如:
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)

为了了解你可以更改什么,你可以在终端中查看ttheme_default()

1
谢谢@user20650。这就是我在寻找的东西。 - KRStam

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接