Using a pheatmap in arrangeGrob
<p>I'm attempting to plate two plots in the same .jpg using arrangeGrob().
I've only just started learning about grids and grobs and I think I know what the problem is: pheatmap is a grid object and containing grob objects, not allowing me to put it in arrangeGrob. Is this true?</p>

<p>Would I somehow need to put the qplot in a grid and the pheatmap in a grid and then put those grids in a new grid? </p>

<pre><code>library(grid)
library(gridExtra)
library(pheatmap)
library(ggplot2)
hmdat=rbind(c(1,2,3),
            c(3,4,5),
            c(5,6,7))
hm=pheatmap(hmdat)
qp=qplot(1,1)
lm=rbind(c(1,2,2),
         c(1,2,2))
jpeg("plots.jpg")
arrangeGrob(qp,hm, layout_matrix=lm)
dev.off()
</code></pre>

<p>The above code snippet runs just fine when using</p>

<pre><code>arrangeGrob(qp,qp, layout_matrix=lm)
</code></pre>