Dedicated classes
You might have noticed that the fread() function produces data frames that look slightly different when you print them out. That's because another class named data.table is assigned to the resulting data frames. The printout of such data.table objects is different. Does something similar happen with the data frames generated by readr?
In your current working directory, we prepared the potatoes.csv file. The packages data.table and readr are both loaded, so you can experiment straight away.
Which of the following statements is true?
This exercise is part of the course
Importing Data in R (Part 1)
Exercise instructions
fread() creates an object whose only class is data.table class. read_tsv() creates an object with class tbl_df.,The class of the result of fread() is only data.table. That of the result of read_tsv() is both tbl_df and tbl.,The class of the result of fread() is both data.table and data.frame. read_tsv() creates an object with three classes: tbl_df, tbl and data.frame.,
fread() creates an object of the data.table class, while read_tsv() simply generates a data.frame, nothing more.Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
Start Exercise