0
votes

Every time I enter this line

cameradata <- read.xlsx("./data/cameras.xlsx" , 1)

I get error:

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.util.zip.ZipException: invalid entry size (expected 500 but got 502 bytes)

I have tried to clear RAM but file size is 10kp

3
If you're sure there is nothing corrupt with the Excel file (that is a possibility since read.xlsx is tossing an error on decompression), have you tried gdata or the myriad of other ways to read an Excel (XLSX) file into R? Without posting a link to the Excel file, it's unlikely you'll get a concrete resolution/suggestion.hrbrmstr

3 Answers

2
votes

Try this :- May be this can work. It worked for me

1) when downloading the xlsx file, use this download.file(fileURL, destfile="./whatever", mode="wb")

2) Switched to regular R, not R Studio,

0
votes

The xlsx file you are trying to read maybe damaged. Try redownload the file or read another "healthy" xlsx file.

0
votes

I had experience exactly the same issue. What I did to resolve the problem was:

  1. I had defined separate variable "fileURL2" and assigned "XLSX" download link
  2. I had defined separate variable "cameraData2" and loaded XLSX file to it
  3. I had downloaded file directly with Firefox and open it with MS Excel to assure it is OK, then I had save it to the working directory of "R" overwriting existing "cameras.xlsx" file
  4. After new attempt to read the file with "R" read.xlsx() - was successful

In conclusion it seems that "R" had corrupted XLSX file during the download - which might be caused by a BUG inside of current version of the language.