4

Is there a way to increase the cell of the column name in a tableGrob item?

library(grid)
d <- head(iris, 3)
g <- tableGrob(d)
grid.newpage()
grid.draw(g)

default:

enter image description here

What I want to achieve (this was done in photoshop): enter image description here

Any help is much appreciated.

user20650
  • 24,654
  • 5
  • 56
  • 91
KRStam
  • 393
  • 5
  • 18

1 Answers1

5

You can do this by changing the padding of the colhead within the theme.

eg

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)

To get an idea of what you can change you can view ttheme_default() in the terminal

user20650
  • 24,654
  • 5
  • 56
  • 91