Data Enthusiast
Data Enthusiast

Reputation: 541

Improve Loading speed of Excel into R dataframe

I am loading an excel spreadsheet in R using xlsx package. It has 50 + columns and 2000 + rows. Load time is around 12 minutes. Is there a way to improve the load speed?

Code I am using :

library(xlsx)
starttime = Sys.time()
res = read.xlsx("ExcelSheet.xlsx",sheetName = "Sheet1")
endtime = Sys.time()  - starttime

print (endtime)

Upvotes: 0

Views: 993

Answers (2)

Data Enthusiast
Data Enthusiast

Reputation: 541

Thanks @eipi , @jenesaisquoi, @alistaire. I could load the data much faster using read.xlsx2.

Upvotes: 0

mlh351
mlh351

Reputation: 319

Try turning the Excel file into a .csv file instead. .csvs read much faster, everything should load in under a minute.

Upvotes: 1

Related Questions