title: Plotting Simple Data in R
body: <p>I have a comma separated file named <code>foo.csv</code> containing the following data:</p>
  
  <pre><code>scale, serial, spawn, for, worker
  5, 0.000178, 0.000288, 0.000292, 0.000300
  10, 0.156986, 0.297926, 0.064509, 0.066297
  12, 2.658998, 6.059502, 0.912733, 0.923606
  15, 188.023411, 719.463264, 164.111459, 161.687982
  </code></pre>
  
  <p>I essentially have two questions:</p>
  
  <p>1) How do I plot the first column (x-axis) versus the second column (y-axis)? I'm trying this (from reading <a href="http://www.ats.ucla.edu/stat/R/gbe/scatter.htm" rel="noreferrer">this site</a>):</p>
  
  <pre><code>data &lt;- read.table("foo.csv", header=T,sep=",")
  attach(data)
  scale &lt;- data[1]
  serial &lt;- data[2]
  plot(scale,serial)
  </code></pre>
  
  <p>But I get this error back:</p>
  
  <pre><code>Error in stripchart.default(x1, ...) : invalid plotting method
  </code></pre>
  
  <p>Any idea what I'm doing wrong? A <a href="http://www.nabble.com/Problems-producing-a-simple-plot-td23347296.html" rel="noreferrer">quick Google search</a> reveals someone else with the same problem but no relevant answer. UPDATE: It turns out it works fine if I skip the two assignment statements in the middle. Any idea why this is?</p>
  
  <p>The second question follows pretty easily after the first:</p>
  
  <p>2) How do I plot the first column (x-axis) versus all the other columns on the y-axis? I presume it's pretty easy once I get around the first problem I'm running into, but am just a bit new to R so I'm still wrapping my head around it.</p>