title: Convert a data read in by fread function to data.frame
body: <p>Assume that I have a sample csv file which has 3 rows and 4 columns. Say it looks like the following:</p>
  
  <pre><code>name1 name2  name3 name4
  11    12     13    14
  21    22     23    24
  31    32     33    34
  </code></pre>
  
  <p>I read it in using <code>fread()</code> (I am using the small sample for illustration purpose):</p>
  
  <pre><code>data &lt;- fread(sample.csv, stringsAsFactors=FALSE)
  </code></pre>
  
  <p>then I do </p>
  
  <pre><code>class(data)
  </code></pre>
  
  <p>it will return </p>
  
  <pre><code>[1] "data.table" "data.frame"
  </code></pre>
  
  <p>I want to see the first element of the fourth column, I tried</p>
  
  <pre><code>data[1,4]
  </code></pre>
  
  <p>But it returns 4 (which I guess is the index of the column).</p>
  
  <p>Interestingly, when I call the following</p>
  
  <pre><code>data[1,] 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>data[1]
  </code></pre>
  
  <p>it returns the first row.</p>
  
  <p>So I did</p>
  
  <pre><code>data &lt;- data.frame(data)
  </code></pre>
  
  <p>to convert data to a data frame.</p>
  
  <p>My questions: <br>
  1. Since the initial data has two classes, is there a way for me to choose one class and 'drop' the other? In my case, I just want to use the data as data frame.<br> 
  2. In general, if data has more than one class, may we choose one class to keep? For instance, <code>as.POSIXct()</code> will return an object with two classes ("POSIXct" "POSIXt"). What if we just want to keep one of the classes? Any function works for this purpose in a generic way?</p>