问题
Thanks in advance. I am trying to install XLConnect package. I am using RStudio. For your information rJava is installed.
Here is my command in R and the error message:
install.packages("XLConnect")
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/XLConnect_0.2-7.zip' Content type 'application/zip' length 17997942 bytes (17.2 Mb) opened URL downloaded 16.7 Mb
Warning in install.packages : downloaded length 17473536 != reported length 17997942
Warning in install.packages : error 1 in extracting from zip file
Warning in install.packages : cannot open compressed file 'XLConnect/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection
回答1:
The warnings indicate that something is corrupting the package download. Quite often the reason is a corporate firewall. You might want to check with your IT whether this is the case.
回答2:
Try installing using standard R and the standard R will tell you where is package zip file is saved. Then you can install using RStudio by installing package from local zip file.
回答3:
I faced similar issue while downloading some package. Try re-installing the package cran using
install.packages("CRAN")
See if it works, if the issue of unmatched length persists uninstall RStudio and install it again.
That seemed to have worked for me.
来源:https://stackoverflow.com/questions/24576507/error-when-installing-xlconnect-in-rstudio