Reputation: 33
I have installed xlsx
and dependent packages. Also I downloaded 64 bit java required to install dependent rjava package. Now when I try to use read.xlsx
I get the below error. After installing 64 bit java, I can successfully load the package but I get an error while running read.xlsx
> library(xlsx)
Loading required package: rJava
Loading required package: xlsxjars
> read.xlsx("ngas.xlsx",sheetIndex = 1)
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.util.zip.ZipException: invalid code -- missing end-of-block
Upvotes: 3
Views: 3977
Reputation: 21
I was getting the exact same error. As the default mode of xlsx file is binary. So, if you add mode='wb', it can do the trick.
download.file(URL="", destfile="",mode='wb')
Upvotes: 2
Reputation: 1226
Check your xlsx file you downloaded is not corrupted by opening it using excel. I had the same issue and found out the file downloaded was corrupt. I manually downloaded using the link provided in the quiz page, did not use R to download.
Upvotes: 0