I have a table, and I want to print a title above it:
t1 <- tableGrob(top_10_events_by_casualties, cols=c("EVTYPE", "casualties"), rows=seq(1,10))
grid.draw(t1)
A similar question was asked here: Adding text to a grid.table plot
I've tried something similar and it doesn't work:
> title <- textGrob("Title",gp=gpar(fontsize=50))
> table <- gtable_add_rows(t1,
+ heights = grobHeight(title) + padding,
+ pos = 0)
Error: is.gtable(x) is not TRUE