title: Using grid_extra after looping with ggplot2
body: <p>I am have to run many ggplots on my data and so am trying to loop through variables. I would like to place the plots in a grid arrangement using grid_extra. I have managed to write code for the loop in order to create the plots for my list but am unsure how to extend that to grid extra. Here is my code: </p>
  
  <pre><code>data("mtcars")
  mtcars$gear=as.factor(mtcars$gear)
  
  lflist=list("mpg", "hp", "drat", "wt")
  lfplot=list()
  for(i in seq_along(lflist)) {
    lfplot=ggplot(data=subset(mtcars, !is.na(gear)), aes(x=gear, 
    y=lflist[i]))+geom_boxplot()+
    stat_summary(fun.y=median, geom="line", aes(group=1), colour="red")+
    stat_summary(fun.y=median, geom="point", colour="red")+
    theme(axis.text.x=element_text(size=8),axis.title.x = element_blank())
  
  }
  </code></pre>