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.
相关问题
- R - Quantstart: Testing Strategy on Multiple Equit
- Using predict with svyglm
- Reshape matrix by rows
- Extract P-Values from Dunnett Test into a Table by
- split data frame into two by column value [duplica
相关文章
- How to convert summary output to a data frame?
- How to plot smoother curves in R
- Paste all possible diagonals of an n*n matrix or d
- ess-rdired: I get this error “no ESS process is as
- How to use doMC under Windows or alternative paral
- dyLimit for limited time in Dygraphs
- What is the tortoisehg gui equivalent of doing “hg
- Saving state of Shiny app to be restored later
I do not have R installed and I needed to find out which R Packages were dependencies upon a list of R Packages being requested for usage at my company.
I wrote a bash script that iterates over a list of R Packages in a file and will recursively discover dependencies.
The script uses a file named rinput_orig.txt as input (example below). The script will create a file named rinput.txt as it does its work.
The script will create the following files:
Bash script:
Example rinput_orig.txt:
Example console output when running script:
Example rdepsfound.txt:
Example routput.txt:
I hope this helps someone!
Another neat and simple solution is the internal function
recursivePackageDependencies
from the librarypackrat
. However, the package must be installed in some library on your machine. The advantage is that it works with selfmade non-CRAN packages as well. Example:giving:
You can use the result of the
available.packages
function. For example, to see whatggplot2
depends on :Which gives :
Note that depending on what you want to achieve, you may need to check the
Imports
field, too.