title: arbitrary number of plots for grid.arrange
body: <p>I'm trying to plot an arbitrary number of bar plots with rmarkdown separated by 2 columns. In my example there will be 20 total plots so I was hoping to get 10 plots in each column, however, I can't seem to get this to work with <code>grid.arrange</code></p>
  
  <pre><code>plot.categoric = function(df, feature){
    df = data.frame(x=df[,feature])
    plot.feature = ggplot(df, aes(x=x, fill = x)) + 
      geom_bar() +
      geom_text(aes(label=scales::percent(..count../1460)), stat='count', vjust=-.4) +
      labs(x=feature, fill=feature) +
      ggtitle(paste0(length(df$x))) +
      theme_minimal()
    return(plot.feature)
  }
  
  
  plist = list()
  for (i in 1:20){
    plist = c(plist, list(plot.categoric(train, cat_features[i])))
  }
  
  args.list = c(plist, list(ncol=2))
  do.call("grid.arrange", args.list)
  </code></pre>
  
  <p>When I knit this to html I'm getting the following output:</p>
  
  <p><a href="https://i.stack.imgur.com/DiUdV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DiUdV.png" alt="enter image description here"></a></p>
  
  <p>I was hoping I would get something along the lines of:</p>
  
  <p><a href="https://i.stack.imgur.com/neLT7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/neLT7.png" alt="enter image description here"></a></p>
  
  <p>but even with this the figure sizes are still funky, I've tried playing with <code>heights</code> and <code>widths</code> but still no luck. Apologies if this is a long question</p>