Importing Data Using data.table – fread in R

Premium

R has a data manipulation package called data.table() which is extensively used for data manipulation. Specially the package is very useful as a data cleaning tool for big data.

The data.table package comes with a function called fread which is a very efficient and speedy function for reading data from files. It is similar to read.table but faster and more convenient. The good thing is that it detects column types (colClasses) and separators (sep) automatically, however you can always specify them manually. Similarly, it can automatically detect the header names and apply to the columns. If the headers are not found, it will conveniently name them automatically.

Unlock Premium Content

Upgrade your account to access the full article, downloads, and exercises.

You'll get access to:

  • Access complete tutorials and examples
  • Download source code and resources
  • Follow along with practical exercises
  • Get in-depth explanations