简体   繁体   中英

Cannot install xlsx package for R

Cannot install R package xlsx.

I have previously used the package on other PCs and had no trouble with it whatsoever, but am having difficulty with a new PC. From what I can tell the issue is something to do with Java. Currently tried:

  • Downloading Java Development Kit
  • Downloading JRE
  • Editing environment variables to point to the right Java (for both of the above)
  • Running through the R console (both 32 and 64 bit)
  • Uninstalling and reinstalling Rstudio / R

install.packages("xlsx")
`Installing package into 'C:/Users/Fred Goktas/Documents/R/win-library/3.3'
(as 'lib' is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
xlsx 0.5.7 0.6.1 FALSE
installing the source package 'xlsx'
trying URL ' https://cran.rstudio.com/src/contrib/xlsx_0.6.1.tar.gz '
Content type 'application/x-gzip' length 315441 bytes (308 KB)
downloaded 308 KB
* installing source package 'xlsx' ...
** package 'xlsx' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
* installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* arch - i386
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/Fred Goktas/Documents/R/win-library/3.3/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/Fred Goktas/Documents/R/win-library/3.3/xlsx'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l
"C:\\Users\\Fred Goktas\\Documents\\R\\win-library\\3.3"
C:\\Users\\FREDGO~1\\AppData\\Local\\Temp\\RtmpYLz0xk/downloaded_packages/xlsx_0.6.1.tar.gz' had status 1
Warning in install.packages :
installation of package 'xlsx' had non-zero exit status

Package should install without any troubles.

除非您没有令人信服的理由使用xlsx ,否则我建议您考虑readxl因为它没有外部依赖项。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM