title: Multiplot of multiplots in ggplot2
body: <p>I recently discovered the <code>multiplot</code> function from the <code>Rmisc</code> package to produce stacked plots using <code>ggplot2</code> plots/objects. What I am trying to do now is to create a multiplot of multiplots. Unfortunately, unlike the <code>ggplot</code> function, <code>multiplot</code> does not produce objects, so my issue cannot be resolved by simply nesting <code>multiplot</code>.</p>
  
  <p>I will create a dataframe to make my point clear. In my dataframe named <code>df</code>, I have 3 columns: <code>period</code>, <code>group</code> and <code>value</code>. A certain value is recorded for each of 3 groups over 10 periods. (Note: I don't use a seed number below despite the use of the <code>sample</code> function because the focus is not numerical, it is graphical)</p>
  
  <pre><code># Create a data frame for illustration purposes
  df &lt;- data.frame(period = rep(1:10, 3),
                   group = rep(LETTERS[1:3], each = 10),
                   value = sample(100, 30, replace = TRUE))
  </code></pre>
  
  <p>I then add a fourth column to <code>df</code>, which is the exponential transformation of the <code>value</code> column.</p>
  
  <pre><code>df$exp.value = exp(df$value)
  </code></pre>
  
  <p>I would like to create stacked plots allowing me to compare the values in each group to their exponential counterparts.</p>
  
  <pre><code> # Split dataframe by group
   df_split &lt;- split(df, df$group)
  
   # Plots of values in each group
   plots &lt;- lapply(df_split, function(i){
     ggplot(data = i, aes(x = period, y = value)) + geom_line()
  })
  
   # Plots of logged values in each group
   plots_exp &lt;- lapply(df_split, function(i){
     ggplot(data = i, aes(x = period, y = exp.value)) + geom_line()
  })
  </code></pre>
  
  <p><code>plots</code> and <code>plots_exp</code> are both lists of 3 elements each containing <code>ggplot</code> objects. The first element of each list corresponds to group A, the second element corresponds to group B and the third element corresponds to group C.</p>
  
  <p>In order to compare each group's values to the exponential values, I can use the <code>multiplot</code> function. Following is an example with group A:</p>
  
  <pre><code>multiplot(plots[[1]], plots_log[[1]], cols = 1)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/V6x5M.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V6x5M.jpg" alt="value_exp.value_grpA"></a></p>
  
  <p>How can I create a grid which will include the multiplot above as well as the ones for groups B and C? As if the code included <code>... + facet_grid(. ~ group)</code>?</p>