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?
The data. table package comes with a function called fread which is a very efficient and speedy function for reading data from files. It is similar to read. table but faster and more convenient.
The benefit of reading the csv file with fread function is that there will be a variable added to the original csv file which contains the id as integers starting from 1 to the length of column values.
C Programming/stdio. h/fread fread is a function that reads buffered binary input from a file. It is included from the stdio. h header file in the standard C library. The fread function copies nmemb items of data of size size from the named input stream into an array pointed to by ptr .
Try this. It worked for me
install.packages("data.table")
library("data.table")
data <- fread("BigDiamonds.csv")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With