title: Making multiple plots with mapply
body: <p>I made the following dataframe <code>df</code>:</p>
  
  <pre><code>V1 &lt;- 1:10
  V2 &lt;- 11:20
  V3 &lt;- 21:30
  V4 &lt;- 31:40
  df &lt;- data.frame(V1,V2,V3,V4)
  </code></pre>
  
  <p>I also made a function which should make a simple scatterplot based on the arguments <code>var1</code> and <code>var2</code>. </p>
  
  <pre><code> ScatterPlot &lt;- function(var1, var2) {
       ggplot(data = df,
       aes(x = var1, y = var2)),
       environment = environment() +
       geom_point()
   }
  </code></pre>
  
  <p>I only want 2 specific scatterplots for the following combinations of variables: <code>v1-v2</code> and <code>v3-v4</code>.</p>
  
  <p>I thought <code>mapply</code> would come in handy here, looping over different combinations of variables.</p>
  
  <pre><code>mapply(FUN = ScatterPlot,
         var1 = c(V1, V3),
         var2 = c(V2, V4))
  </code></pre>
  
  <p>I just expected 2 plots but this is what I got instead:</p>
  
  <p><img src="https://i.stack.imgur.com/gvFQc.png" alt="enter image description here"></p>