I would like to know how to arrange one grob object (a table) inside another. Consider the following example:
library(ggplot2)
library(gridExtra)
p1 <- qplot(data=mtcars, x = mpg, y = hp, facets = ~ hp, geom="point")
t1 <- tableGrob(head(mtcars))
print(arrangeGrob(p1, t1))
This yields:
What I would like to do is place the table inside the other object like this:
Is this possible to do using gridArrange
or perhaps some other methods from grid
and/or gridExtra
?