0

我最近安装了带有 packages 的 R 3.2.0(Windows 64 位)xlsx,这取决于rJavaxlsxjars. 机器上安装了 Java 1.8.0_11 64 位。

当我尝试使用该read.xlsx()功能时,我收到以下有关 zipfile 的错误:

> library(xlsx)
Loading required package: rJava
Loading required package: xlsxjars
> read.xlsx("cameras.xlsx", sheetIndex=1)

错误.jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :java.util.zip.ZipException:无效距离太远

我当然不知道为什么它会尝试解压缩任何东西,除非它是 R 软件包附带的 jar 之一。(当我手动解压时,R 包的 zip 文件解压缩得很好。)我已经重新安装了两次,但如果那里发生损坏,我还是无济于事。

我觉得某处存在配置错误,但我真的很难过。有没有其他人经历过这个?这是软件包安装消息

> install.packages("xlsx")
Installing package into ‘C:/Users/ggraham412/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rJava’, ‘xlsxjars’

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/rJava_0.9-6.zip' 
Content type 'application/zip' length 761928 bytes (744 KB)
downloaded 744 KB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/xlsxjars_0.6.1.zip'
Content type 'application/zip' length 9485172 bytes (9.0 MB)
downloaded 9.0 MB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/xlsx_0.5.7.zip'
Content type 'application/zip' length 400857 bytes (391 KB)
downloaded 391 KB

package ‘rJava’ successfully unpacked and MD5 sums checked
package ‘xlsxjars’ successfully unpacked and MD5 sums checked
package ‘xlsx’ successfully unpacked and MD5 sums checked
4

1 回答 1

1

原来这是这里描述的问题:R xlsx package error

不知道在上述过程中 zip 库访问了 xlsx 文件,确实我没有将电子表格下载为二进制文件。

于 2015-05-06T03:18:51.960 回答