Loading data for use in dplyr

Loading the data can be performed using whichever data import function you prefer. Personally, I almost always use fread but the read.*-family of functions will work just fine. But it seems the most popular for most tidyverse-ers is to use the read_*-family of functions from the readr package.

It can be looked at like this: fread is to data.table as the readr import functions are dplyr/tidyverse. This analogy holds for two main reasons: (a) each method, by default, returns a special type of data.frame that is optimized in various ways to the functionality of the respective packages, and (b) the use of the import alternative is not strictly necessary but often helpful for speed.

On the former point, the object ...

Get Data Analysis with R - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.