简体   繁体   中英

XLConnect: unable to find an inherited method for function readWorksheet?

I have the following code

FXwb <- loadWorkbook("FX_r_2.xlsx")
x <- readWorksheet(FXwb, sheet=1)

And I get the error saying unable to find an inherited method for function readWorksheet. This code used to work before, and the only thing I've changed is adding

options(java.parameters = "- Xmx1024m")

To allow for more memory. Also, my data in Excel got significantly larger (from 200 rows to 7,000) so I'm not sure if that had something to do with it as well.

I tried to reproduce your problem, but I saw no problem:

library(XLConnect)
options(java.parameters = "- Xmx1024m")
FXwb <- loadWorkbook("FX_r_2.xlsx")
x <- readWorksheet(FXwb, sheet=1)
str(x)
'data.frame':   7000 obs. of  3 variables:
 $ a: num  1 2 3 4 5 6 7 8 9 10 ...
 $ b: num  1 2 3 4 5 6 7 8 9 10 ...
 $ c: num  1 2 3 4 5 6 7 8 9 10 ...

Perhaps you can find the answer in this thread: Error in XLConnect

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM