在R中安装r2excel软件包时遇到问题

时间:2018-09-25 14:11:24

标签: r r-xlsx

我正在尝试通过install_github在R中安装r2excel软件包,但出现此错误

> install_github("kassambara/r2excel")

控制台中出现几行,我得到

* installing *source* package 'r2excel' ...
** R
** preparing package for lazy loading
Warning: package 'xlsx' was built under R version 3.4.4
** help
*** installing help indices
  converting help for package 'r2excel'
    finding HTML links ... done
    getOS                                   html  
    r2excel-package                         html  
    xlsx.addHeader                          html  
    xlsx.addHyperlink                       html  
    xlsx.addLineBreak                       html  
    xlsx.addParagraph                       html  
    xlsx.addPlot                            html  
    xlsx.addTable                           html  
    xlsx.openFile                           html  
    xlsx.readFile                           html  
    xlsx.writeFile                          html  
    xlsx.writeMultipleData                  html  
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning: package 'xlsx' was built under R version 3.4.4
Error: package or namespace load failed for 'xlsx':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: No CurrentVersion entry in Software/JavaSoft registry! Try re-    installing Java and make sure R and Java have matching architectures.
Error : package 'xlsx' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
Warning: package 'xlsx' was built under R version 3.4.4
ERROR: loading failed for 'i386'
* removing 'C:/Users/myusername/Documents/R/win-library/3.4/r2excel'
In R CMD INSTALL
Installation failed: Command failed (1)        

所以我在加载“ xlsx”时收到此错误
奇怪的是,我可以轻松地用

分别加载“ xlsx”和“ rJava”
library(xlsx)

我安装了x64 java(内部版本1.8.0_161-b12)和x64 rStudio,因此我真的不知道问题出在哪里。

1 个答案:

答案 0 :(得分:0)

根据https://github.com/kassambara/r2excel/issues/6中的liuyanguu:

“该软件包不是在64位系统中构建的,因此我们无法以这种方式安装它。但是您仍然可以通过克隆存储库和源代码或仅复制粘贴“ /R/r2excel.r”来使用所有功能。实际上不需要安装该软件包。”