15

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?

3
  • 11
    fread is in the data.table package isn't it? Have you loaded it? May 29, 2017 at 3:46
  • 1
    Yes, looks like the issue is the absence of library(data.table).
    – neilfws
    May 29, 2017 at 3:49
  • 4
    Use data.table::fread("BigDiamonds.csv")
    – akrun
    May 29, 2017 at 3:53

1 Answer 1

19

Try this. It worked for me

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.