The answer involving grid.layout
works, I've used it, and I up-voted it. However, I usually find this solution much too tedious and error-prone, and I suspect most ggplot2 enthusiasts that do this regularly have wrapped this up in a function. I have found several such wrapping functions in previous searches, but my current workhorse solution is in a grid addon package called gridExtra. It has useful arguments, but the default rows/columns setup is often what you wanted in the first place:
library("ggplot2")
# Generate list of arbitrary ggplots
plot1 <- qplot(data = mtcars, x=wt, y=mpg, geom="point",main="Scatterplot of wt vs. mpg")
plot2 <- qplot(data = mtcars, x=wt, y=disp, geom="point",main="Scatterplot of wt vs disp")
plot3 <- qplot(wt,data=mtcars)
plot4 <- qplot(wt,mpg,data=mtcars,geom="boxplot")
plot5 <- qplot(wt,data=mtcars)
plot6 <- qplot(mpg,data=mtcars)
plot7 <- qplot(disp,data=mtcars)
# You might have produced myPlotList using instead lapply, mc.lapply, plyr::dlply, etc
myPlotList = list(plot1, plot2, plot3, plot4, plot5, plot6, plot7)
library("gridExtra")
do.call(grid.arrange, myPlotList)
Notice how the actual "combine my plots into one graphic" code was one line (after loading gridExtra). You might argue that putting the plots into a list was an extra line, but actually I could have alternatively used
grid.arrange(plot1, plot2, plot3, plot4, plot5, plot6, plot7)
For small numbers of ggplots this might be preferable. However, for n_plots > 4
you will begin to resent having to name and type them all.