[R-pkg-devel] Question regarding listing base and recommended packages programmatically and efficiently

Tony Wilkes tony_@_w||ke@ @end|ng |rom out|ook@com
Thu Oct 12 14:34:12 CEST 2023


Dear all,

In my R package that I'm developing, I use `installed.packages(priority = "base")` to programmatically get all core/base R packages (i.e. base, stats, etc.). And similarly, I use installed.packages(priority = "recommended")​` to programmatically get the recommended R packages (i.e. mgcv, lattice, etc.).

However, CRAN has requested to not use `installed.packages()`, as it is slow. I fully get and agree with that assesment. I used installed.packages()​` anyway because I could not find a better, fool-proof alternative.

Nonetheless, I was asked to change this code for optimalisation. So I would like to ask: how do I programmatically get all base/core R packages safely and efficiently, but without using `installed.packages()`? And the same question for recommended R packages. I have of course Googled it, and looked at R's documentation (though R's documentation is large, so it's easy to miss something); no solution found. So if any of you has a smart idea: I'm all ears.

Thank you in advance.

Kind regards,

Tony.

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list