在 R 中安装 r2excel 包时遇到问题
Posted
技术标签:
【中文标题】在 R 中安装 r2excel 包时遇到问题【英文标题】:Trouble with installing r2excel package in R 【发布时间】:2019-03-01 04:50:56 【问题描述】:我正在尝试通过 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,所以我真的不知道问题出在哪里。
【问题讨论】:
installing Java and make sure R and Java have matching architectures. ERROR: loading failed for 'i386'
。你有安装 R x64 吗?
仅供参考,以下软件包不需要Java
即可工作:github.com/tidyverse/readxl | github.com/ropensci/writexl | github.com/awalker89/openxlsx
【参考方案1】:
据https://github.com/kassambara/r2excel/issues/6的liuyanguu:
“这个包不是在 64 位系统中构建的,所以我们不能这样安装。但是你仍然可以通过克隆 repo 和源或复制粘贴“/R/r2excel.r”来使用所有功能。那里其实是不需要安装包的。”
【讨论】:
以上是关于在 R 中安装 r2excel 包时遇到问题的主要内容,如果未能解决你的问题,请参考以下文章
当我尝试在 R 中安装 Mosaic 包时,这个错误是啥意思?