title: How do I share raw data used for ggplot2 graphs?
body: <p>I am in the strange position of being responsible for data visualization, but there is a good chance that our client will want to change some or all of the graphs I create after they are delivered. Is there an R package (or technique) which can export raw data used to make ggplot2 graphs as .csv files along with the images as they are created?</p>
  
  <p>For example, in a bar chart, I take a survey response, which is a string, and turn it into a factor variable, using</p>
  
  <pre><code>    ggplot(subset(data.df, !is.na(xvar)), aes(factor(xvar))
  </code></pre>
  
  <p>in order to plot it. I can go through the extra step of selecting the subset of my data again and writing a little .csv file with just the IDs and that variable, but it will be a string again. Help me! I don't want to have to do all this in Excel.</p>