0

I want to programatically save some packages my script has loaded (I mean the actual directory).

I know doing .libPaths() shows the paths where the packages can come from (though I could also load it from somewhere different).

Is there an already build function to get where a package that I loaded comes from ?

statquant
  • 13,672
  • 21
  • 91
  • 162
  • 2
    You are searching something like `path.package()` and `find.package()` ?https://stat.ethz.ch/R-manual/R-devel/library/base/html/find.package.html – J_F Sep 16 '16 at 12:39

1 Answers1

1

My solution would be:

sess.info <- sessionInfo()

names.packages <- names(sess.info$loadedOnly)

find.package(names.packages)

I hope this is what you are searching for.

J_F
  • 9,956
  • 2
  • 31
  • 55