title: Loop through data frame and variable names
body: <p>I am looking for a way to automate some diagrams in R using a FOR loop:</p>
  
  <pre><code>dflist &lt;- c("dataframe1", "dataframe2", "dataframe3", "dataframe4")
  
  for (i in dflist) {
    plot(i$var1, i$var2)
  }
  </code></pre>
  
  <p>All dataframes have the same variables, i.e. var1, var2. </p>
  
  <p>It seems <code>for</code> loops are not the most elegant solution here, but I don't understand how to use the <code>apply</code> functions for diagrams.</p>
  
  <p>EDIT:</p>
  
  <p>My original example using <code>mean()</code> didn't help in the original question, so I changed it to a plot function.</p>