I am very new to R, and am reading an excel file (size 27,964 KB) into R using read.xlsx
from library open.xlsx
.
filename = "myfile.xlsx"
df1 = read.xlsx(filename, sheet="df1",colNames= TRUE)
df2 = read.xlsx(filename, sheet="df2",colNames= TRUE)
There are multiple sheets in the excel file. Right now I am reading one sheet at a time, but I want to automate the process and be able to create data frames according to sheet names.
I read we can use XLConnect
for this purpose, but when I tried XLConnect
in my case, I got the an error
wb = loadWorkbook("myfile.xlsx")
Error: OutOfMemoryError (Java): GC overhead limit exceeded
In order to fix this error I used
options(java.parameters = "-Xmx1024m")/"Xmx2g"
but both the options did not help. I tried reading about exce.link but could not really figure it out.
Can some one please guide how to use another method to read excel file with multiple sheets.