title: Why is ggplot not plotting multiple windows in R?
body: <p>I am having a problem with a couple R functions I wrote. I have 2 plotting functions and I want to write a function that creates plots for both of the functions. This function looks like this</p>
  
  <pre><code> plotBoth = function(path = NULL){
       plotPopulationStats(path)
       plotInstructionFrequencies(path)
   }
  </code></pre>
  
  <p>However only whichever instruction I call second gets plotted, while the first instruction only plots a blank window. Below are simplified versions of these functions.</p>
  
  <pre><code> plotInstructionFrequencies = function(path = NULL){
     quartz()
     table &lt;- read.table(path, header=TRUE);
     frame &lt;- as.data.frame(table);
     frame$time = seq(1, length(table$noop));
     frame$mean = NULL
     frame$sd = NULL
     frame$variance = NULL
     Molten &lt;- melt(frame, id.vars = "time");
     ggplot(Molten, aes(x = time, y = value, colour = variable)) + geom_line()
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>plotPopulationStats = function(path = NULL){
      quartz()
      table &lt;- read.table(path, header=TRUE);
      frame &lt;- as.data.frame(table);
      frame$time = seq(1, length(table$noop));
      frame$noop = NULL
      frame$plus = NULL
          ...
      frame$store = NULL
          Molten &lt;- melt(frame, id.vars = "time");
      ggplot(Molten, aes(x = time, y = value, colour = variable)) + geom_line();
  }
  </code></pre>
  
  <p>All the functions are in separate files, but I would like to have them all in one file.</p>
  
  <p>Both functions plot fine when called individually. </p>