title: Using read.table for specific columns of .csv files
body: <p>I have tried asking this question before, but was a bit sloppy and confusing in delivering my data. For context, see <a href="https://stackoverflow.com/questions/48566897/importing-fread-vs-read-table-and-errors/48585662?noredirect=1#comment84170557_48585662">Importing fread vs read.table and errors</a>. </p>
  
  <p>I want to read in a selection of columns from a bunch of .csv files and bind these together. As these .csv files are very big, it is not possible to import the files completely. </p>
  
  <p>I tried to do this using the following piece of code for columns 1,2,3,25 and 29:</p>
  
  <pre><code>my.files &lt;- list.files(pattern=".csv")
  my.data &lt;- lapply(my.files,fread, header = FALSE, sep=",", select = c(1,2,3,25,29)) 
  df &lt;- do.call("rbind", my.data)
  </code></pre>
  
  <p>However, using <code>fread</code> made the resulting datafile consist of characters, making it impossible to create good graphs. I tried to convert <code>character</code> data to <code>numeric</code> (see the context link), but that didn't work out as well.</p>
  
  <p>When using <code>read.table</code> instead of <code>fread</code> on one of the files, the data is read in correctly. Therefore I would want to create a piece of code that does the same as the piece of code with <code>fread</code>, but with <code>read.table</code>. I tried the following code, but that didn't work.</p>
  
  <pre><code>my.files &lt;- list.files(pattern=".csv")
  my.data &lt;- lapply(my.files,read.table, header = FALSE, sep=",", colClasses = c(1,2,3,25,29)) 
  df &lt;- do.call("rbind", my.data)
  </code></pre>
  
  <p>How can I read in specific columns from the .csv files with read.table and binding these together, while avoiding having to read in the complete files?</p>