简体   繁体   English

强制install.packages()

[英]Force install.packages()

Is it possible to install a package in R forcefully ? 是否有可能在R中强行安装包?

> install.packages("gsubfn")
Installing package(s) into ‘/home/sebastian/R/x86_64-unknown-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘gsubfn’ is not available (for R version 2.14.2)

In this case the package requires R >= 2.15 and I only have R 2.14.2 . 在这种情况下,包需要R> = 2.15而我只有R 2.14.2。 Wondering whether I can do a force install . 想知道我是否可以进行强制安装。

Download the package from the source. 从源代码下载包。 Unzip it, and move the folder to the library (~/R/2.14/Library). 解压缩,然后将文件夹移动到库(〜/ R / 2.14 / Library)。 Go to your IDE and do a library(<package_name>) 转到IDE并执行library(<package_name>)

This may or may not work properly and you are most likely to get a similar warning message saying that package <name> was built under R 2.14 . 这可能会或可能不会正常工作,您最有可能收到类似的警告消息,说package <name> was built under R 2.14 Ignore it. 忽略它。 Most of the functions should work. 大多数功能都应该有效。 Be warned, however, there may be some functions which spew funny output, or none at all, as they might be using some features which are not in R 2.14. 但是,请注意,可能会有一些功能会产生有趣的输出,或者根本没有,因为它们可能会使用某些不在R 2.14中的功能。

You could, however, update your R version. 但是,您可以更新您的R版本。 That, IMO, is the best way to go. 那,IMO,是最好的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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