title: R function list with undetermined length as an argument
body: <p>I am using the <code>multiplot</code> function of this <a href="http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/" rel="nofollow noreferrer">website</a></p>
  
  <p>This function takes as argument an indefinite number of plots and plot them together. With the code below I can plot for example 4 plots together in 2 columns.</p>
  
  <pre><code>library(ggplot2)
  n = 4
  p = lapply(1:n, function(i) {
      ggplot(data.frame(x = 1:10,y = rep(i,10)), aes(x = x, y = y)) +
      geom_point()
  })
  
  multiplot(p[[1]],p[[2]],p[[3]],p[[4]],cols = 2)
  </code></pre>
  
  <p>How can I do if I have an undetermined number of plots <code>n</code> ? </p>
  
  <p>I already tried things like </p>
  
  <pre><code>multiplot(p,cols = 2)
  do.call(multiplot, list(p,cols = 2))
  </code></pre>
  
  <p>but it doesn't give the result that I want</p>