Occasionally I’d like to plot a table alongside a chart in R, e.g. to present summary statistics of the graph itself. Thanks to the
gridExtrapackage this is quite straightforward. The function
tableGrobcreates a table like plot of a data frame, while
arrangeGroballows me to arrange
gridgraphical objects (short ‘grobs‘, such as
tableGrob) on a page.
Here is a little example:
R version 3.1.3 (2015-03-09) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.10.3 (Yosemite) locale:  en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages:  grid stats graphics grDevices utils  datasets methods base other attached packages:  gridExtra_0.9.1 ggplot2_1.0.1 loaded via a namespace (and not attached):  colorspace_1.2-6 digest_0.6.8 gtable_0.1.2  labeling_0.3 MASS_7.3-40 munsell_0.4.2  plyr_1.8.1 proto_0.3-10 Rcpp_0.11.5  reshape2_1.4.1 scales_0.2.4 stringr_0.6.2  tools_3.1.3