通常情况下,install.packages(..., type = "both")
如果有需要从源代码构建的包,则需要用户输入。
例如(目前,R 3.5.1),install.packages(c("feather", "tidyr"), type = "both"))
将从二进制安装 tidyr 并从源代码安装 Feather,只要用户在进行 Feather 安装时单击“是”即可。
有没有办法自动单击“是”,或者不需要用户通过某些选项输入install.packages()
?
Note: install.packages(..., type = "source")
不需要用户输入,但它会构建所有包,在这种情况下这不是理想的行为。
The install.packages.compile.from.source
选项可以设置为"always"
从源安装软件包而不提示用户界面。默认为"interactive"
,使用时会提示用户确认type="both"
.
解决方案:
options(install.packages.compile.from.source = "always")
install.packages(c("feather","tidyr"), type = "both")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)