I have a package in my library and I do not know where it came from. Presumably it was downloaded as a dependency of another package I use. How can I find out which package(s) are dependent on a package of interest?
You can use installed.packages
which gives the list of all your installed packages with their dependencies (as a matrix object). Say for instance that you want to find which packages are dependent on rJava
:
#get my installed packages
x<-installed.packages()
#find packages dependent on rJava
x[grepl("rJava",x[,"Depends"]),"Package"]
#the result for my R installation
# XLConnect xlsx xlsxjars
#"XLConnect" "xlsx" "xlsxjars"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With