Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I determine what packages are dependent on a given package in R?

Tags:

r

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?

like image 948
CephBirk Avatar asked Nov 02 '14 04:11

CephBirk


1 Answers

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"
like image 154
nicola Avatar answered Oct 16 '22 14:10

nicola