kohske/ggplot2 — comment on commit 01aec607f398d1d4d49fdf8c78513fb7491f090b
File: R/ggarrange.r line 137
By baptiste:

there seems to be a case for a new generic method here, "as.grob" perhaps. Methods could be provided such as as.grob.default() doing nothing, gtable_gTree for as.grob.gtable(), ggplotGrob for as.grob.ggplot(), even lattice could take care of defining its own as.grob.trellis() elsewhere.

Here, you'd just call lapply(plots, as.grob) and the class would dispatch accordingly.