title: Finding attributes of individual plots generated in a for loop
body: <p>I am trying to work out the gradient and the correlation index of the graphs I have created from a dataframe. There should be a graph produced from each column of the dataframe. To get the graphs I have used this code:</p>
  
  <pre><code>for(c in names(x15.sub))
  print(ggplot(data=x15.sub) + geom_point(aes(x = x15.sub[[c]], y = T8641))
      + geom_smooth(method = lm, aes(x = x15.sub[[c]], y = T8641))+ labs(x=c))
  </code></pre>
  
  <p>I think I need to use the command 'attributes' to get the gradient, but I can't work out where to out it in the code, as each graph seems to be generated without a 'name'. 
  I also can't work out how to save the graphs. Any help would be much appreciated! </p>