列出R包依赖关系而不安装软件包 [英] Listing R Package Dependencies Without Installing Packages
本文介绍了列出R包依赖关系而不安装软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一个简单的方法来获取给定包的R包依赖关系(所有递归依赖)的列表,而不安装包和依赖关系?类似于portupgrade或apt中的假安装的东西。
Is there a simple way to get a list of R package dependencies (all recursive dependencies) for a given package, without installing the package and it's dependencies? Something similar to a fake install in portupgrade or apt.
推荐答案
可以使用可用的结果.packages
函数。例如,看看 ggplot2
取决于:
You can use the result of the available.packages
function. For example, to see what ggplot2
depends on :
pack <- available.packages()
pack["ggplot2","Depends"]
其中给出:
[1] "R (>= 2.14), stats, methods"
请注意,根据您想实现的内容,您可能需要检查 Imports
字段。
Note that depending on what you want to achieve, you may need to check the Imports
field, too.
这篇关于列出R包依赖关系而不安装软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文