Read xlsx files in Rstudio

I am taking the R programming class from Cousera and while I was practicing how to read xlsx files using read.xlsx I came across the following error message:

dat<- read.xlsx(file="./data/nga.xlsx", sheetIndex=1)

      

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,

: java.util.zip.ZipException: Excessive literal / long trees

R version 3.2.1, studio studio R 3.2.1, windows7 64bit platform. Can anyone give a hint what this message means and how to get around it?

Thanks, Gezimao

+3


source to share


4 answers


The file you downloaded was corrupted, so download this file again using the 'mode = "wb" parameter.



+2


source


try this package https://github.com/hadley/readxl



read_excel("my-new-spreadsheet.xlsx")

      

+1


source


Download and install this java: http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

then run your code and it should work. If it checks for the best answer :)

0


source


I had the same problem. The .xlsx file can be read-only. Try "Save As" to a new file from Excel and try read.xlsx again.

-1


source







All Articles