Could not find function 'fread' in R 3.4 while reading a big dataset

Ranjan Kumar picture Ranjan Kumar · May 29, 2017 · Viewed 18.8k times · Source

I have installed package "microbenchmark" and then run: library(microbenchmark).

Now, I am trying to read a csv file, but getting the error: "fread" function not found.

setwd("C:/Data Analytics/R Assignments")
library(microbenchmark)
data <- fread("BigDiamonds.csv") 

Error in
fread("BigDiamonds.csv") : could not find function "fread"

I have been using R 3.4. Could that be the issue?

Answer

Himanshu Poddar picture Himanshu Poddar · Nov 3, 2018

Try this. It worked for me

install.packages("data.table")
library("data.table")
data <- fread("BigDiamonds.csv")