How to combine multiple ggplots?

library(ggplot2)
p1 <- ggplot(mpg) + geom_point(aes(x = class, y = hwy, color = drv))
p2 <- ggplot(mpg) + geom_boxplot(aes(x = class, y = hwy, fill = drv))
p3 <- ggplot(mpg) + geom_bar(aes(class, fill = drv))

patchwork

library(patchwork)
(p1 + p2) / p3

plot of chunk patchwork12.2

cowplot

library(cowplot)
plot_grid(plot_grid(p1, p2, ncol = 2), p3, ncol = 1)

plot of chunk cowplot12.2

gridExtra

library(gridExtra)
grid.arrange(arrangeGrob(p1, p2, ncol = 2), p3, ncol=1)

plot of chunk gridExtra12.2