title: Reading two-column data with read.table results in three columns
body: <p>I am using <code>read.table()</code> to get data from a web page. The data table has two columns and is from NIST. Following is my code, including the URL if you want to preview the data:</p>
  
  <pre class="lang-r prettyprint-override"><code>    options(digits = 12)
      theURL &lt;- "https://www.itl.nist.gov/div898/strd/anova/AtmWtAg.dat"
      AgData &lt;- read.table(theURL, header = TRUE , skip = 59)
      # Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
      # line 1 did not have 3 elements
      AgData$Instrument = as.factor(AgData$Instrument)
      fitAgData = aov(AgWt ~ Instrument, data=AgData)
  
  </code></pre>
  
  <p>I have inserted the error message as a comment in the code where it occurs.</p>
  
  <p>Other answers on stack exchange seem to deal with missing values causing this error. The data on this site is complete, so I'm not sure what is causing the error.</p>
  
  <p>So far, I have fiddled with the <code>skip =</code> value; inserted the column names as a <code>read.table</code> argument; and added <code>fill = TRUE</code> to <code>read.table</code> The latter one resulted in a data table with three columns, one containing <code>NA</code> values. Since there are names in the table,  I have the <code>header=TRUE</code> argument on.</p>
  
  <p>Somehow <code>read.table()</code> thinks there are three columns, and I don't see a way to tell it there are two.</p>
  
  <p>After the skipped rows, I saw the start of the file like this:</p>
  
  <pre><code>Data:  
        Instrument           AgWt
            1            107.8681568
            1            107.8681465
            1            107.8681572
            1            107.8681785
  </code></pre>
  
  <p>In fact, the data looks like this:</p>
  
  <pre><code>Data:  Instrument           AgWt
             1            107.8681568
             1            107.8681465
             1            107.8681572
             1            107.8681785
  </code></pre>