title: R: plot.new has not been called yet
body: <p>i know, it is an very old problem, mentioned in <a href="https://stackoverflow.com/questions/7154133/plot-new-has-not-been-called-yet">plot.new has not been called yet</a> etc. but nevertheless, the answers there where not working for me so i have to ask it again:</p>
  
  <p>I am reading a short table with 30 lines with data, two different tables:</p>
  
  <pre><code>lines &lt;-scan("Wanna.txt", what="character", sep='\n')
  </code></pre>
  
  <p>It has the following structure: </p>
  
  <pre><code>AA BB
  5  149
  12 5
  15 5
  100 7
  ...
  AA BB
  5 1
  10 136
  23 150
  100 3
  </code></pre>
  
  <p>I then read the tables into a data structure:</p>
  
  <pre><code>Wanna5 &lt;- read.table(textConnection(lines[1:5]), header=TRUE)
  Wanna15 &lt;- read.table(textConnection(lines[7:11]), header=TRUE)
  </code></pre>
  
  <p>When i do a ggplot, it works</p>
  
  <pre><code>ggplot(data=Wanna5, mapping= aes(x=AA, y=BB)) + geom_line()
  </code></pre>
  
  <p>When i try to add the simple second data set</p>
  
  <pre><code>lines(Wanna15$AA, Wanna15$BB, type="l", col="green")
  </code></pre>
  
  <p>It tells me the old error:</p>
  
  <pre><code>Error in plot.xy(xy.coords(x, y), type = type, ...) : 
  plot.new has not been called yet
  </code></pre>
  
  <p>What to do?</p>