title: for loop not creating multiple ggplot objects
body: <p>I'm hoping to create a ggplot function which loops through a list of objects, and creates individual ggplot objects. The code below successfully prints out the last plot in the list, but nothing is saved as an object. </p>
  
  <p>Thanks in advance for any assistance!</p>
  
  <pre><code>negbinom_list &lt;- c("cytoxic_CD4_CD8.wt.negbinom", "helper_CD4.wt.negbinom")
  
  
  VolPlot &lt;- function(data, title){
  
  highlight_df &lt;- data %&gt;% filter(p_val_adj&lt;=0.05) %&gt;% filter(avg_logFC&lt;=-0.5 | avg_logFC&gt;=0.5)
  data$ID &lt;- row.names(data)
  label_df &lt;- filter(data, ID %in% GOI)
  data$ID &lt;- row.names(data)
  VolPlot_name &lt;- paste( 'volplot', title, sep = '.' )
  VolPlot_name &lt;- ggplot(data=data, 
              aes(x=avg_logFC, y =-log10(p_val_adj))) +
    geom_point(alpha=0.4, size=1.75) +
    xlim(c(-2, 2)) +
    xlab("log2 fold change") + ylab("-log10 adjusted p value") +
    theme_bw() +
    theme(legend.position="none") +
    geom_point(data=highlight_df, aes(x=avg_logFC, y =-log10(p_val_adj)), color='red', alpha=0.4,size=1.75) +
    geom_text(aes(label=ifelse(avg_logFC&lt;=-0.75 | avg_logFC&gt;=0.75,as.character(ID),'')),hjust=0,vjust=0) +
    geom_label_repel(data = label_df, aes(label = ID), nudge_y = 36, nudge_x = 1, direction = "x")
  }
  for(i in negbinom_list){
    print(VolPlot(get(i), i))
  }
  </code></pre>