data <- read_delim("imported_data.csv", delim = ",")
data <- read_csv("imported_data.csv")
data <- read.csv("imported_data.csv")
data <- fread("imported_data.csv")
All these function have the same output, which one should I use? When it comes to more sophisticated functions, again what should I do? Thanks.
Use the one that's most appropriate for the situation.
If you are using Dplyr and related libraries, use read_csv
or read_delim
. The former is a convenience wrapper for the latter, so use whichever one seems most logical to you.
If you are using Data.table, use fread
. Data.table has better performance on very large datasets, compared to Dplyr.
If you are not using either of those libraries, use read.csv
or read.table
because they are included in base R.