How can I add a title to a tableGrob plot?

前端 未结 2 439
鱼传尺愫
鱼传尺愫 2021-01-04 22:42

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))
gri         


        
2条回答
  •  余生分开走
    2021-01-04 23:29

    Another option is:

    library(gridExtra)
    grid.arrange(top="Iris dataset", tableGrob(head(iris)))
    

    You still might want to do some tweaking with the padding.

提交回复
热议问题