title: Loop with a defined ggplot function over multiple dataframes
body: <p>I would like to make a loop to plot data from multiple dataframes in R, using a a pre-existing ggplot function called myplot.</p>
  
  <p>My ggplot function is defined as myplot and the only things I'd like to extract are titles. I know there are similar posts, but none provides a solution for a pre-existing ggplot function. </p>
  
  <pre><code>df1 &lt;- diamonds[1:30,] 
  df2 &lt;- diamonds[31:60,]
  df3 &lt;- diamonds[61:90,]
  
  myplot &lt;- ggplot(df1, aes(x = x, y = y)) +
  geom_point(color="grey") +
  labs(title = "TITLE")
  
  list &lt;- c("df1","df2","df3")
  titles &lt;- c("df1","df2","df3")
  </code></pre>
  
  <p>Here is my try:</p>
  
  <pre><code>for (i in list) {
    myplot(plot_list[[i]])
    print(plot_list[[i]])
  }
  </code></pre>