我正在尝试安装一个包R
来自 CRAN 存储库。我必须在配置阶段,但我不知道如何做到这一点install.packages
:
> install.packages("Rmpfr")
..........
checking mpfr.h usability... no
checking mpfr.h presence... no
checking for mpfr.h... no
configure: error: Header file mpfr.h not found;
**maybe use --with-mpfr-include=INCLUDE_PATH**
(注意:我已将 MPFR 安装在自定义位置,因为我不是 root)。
但是我如何将带有参数的特定标志传递给install.package
的命令R
?例如“ --with-mpfr-include=/path/to/mpfr/include ”
基于install.packages
手册页,我已经尝试过:
install.packages("Rmpfr" , INSTALL_opts = "--with-mpfr-include=/path/to/mpfr/include")
install.packages("Rmpfr" , configure.args = "--with-mpfr-include=/path/to/mpfr/include")
install.packages("Rmpfr" , configure.vars = "--with-mpfr-include=/path/to/mpfr/include")
但他们都没有工作,并出现同样的错误。
我自己刚刚尝试安装时偶然发现了这个问题udunits2作为一个依赖项ggforce. 这个答案在 R devel 邮件列表上适用于我的情况:我需要将一个命名字符向量传递给configure.args
密钥由包裹名字。这应该适合您的情况,然后:
install.packages("Rmpfr",
configure.args = c(Rmpfr = "--with-mpfr-include=/path/to/mpfr/include"))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)