16

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? Commented May 29, 2017 at 3:46
  • 1
    Yes, looks like the issue is the absence of library(data.table).
    – neilfws
    Commented May 29, 2017 at 3:49
  • 4
    Use data.table::fread("BigDiamonds.csv")
    – akrun
    Commented May 29, 2017 at 3:53

1 Answer 1

20

Try this. It worked for me

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

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