title: "Error in scan" while reading a large file in R
body: <p>I have a large file of about 5,00,000 rows and 1000 columns. I am trying to read it in R as follows:</p>
  
  <pre><code>&gt; tab5rows &lt;- read.delim("file_name.txt", header=TRUE,nrows=5)
  &gt; classes &lt;- sapply(tab5rows, class)
  &gt; data &lt;- read.delim("file_name.txt",  header=TRUE,nrows=500000,colClasses=classes,comment.char="")
  </code></pre>
  
  <p>But on doing the last line, I get the following error. </p>
  
  <pre><code>Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
    scan() expected 'an integer', got '0,00'
  </code></pre>
  
  <p>Can anyone help me know how do i resolve this? I cannot open my file in notepad or excel as it is very large. How can I resolve this from R ?</p>
  
  <p>Your help appreciated.
  Thanks in advance.</p>