Programmatically get a list of base packages

How can I get R to indicate its basic installation packages. Dirk gives the list HERE , but how can I get R to tell me this information, that is, the packages in src/library/?

getOption("defaultPackages") close but lists only some of these packages.

+5
source share
2 answers
rownames(installed.packages(priority="base"))
 [1] "base"      "compiler"  "datasets"  "graphics"  "grDevices" "grid"     
 [7] "methods"   "parallel"  "splines"   "stats"     "stats4"    "tcltk"    
[13] "tools"     "utils"    
+10
source

There may be a simpler method, but I think this should do the trick:

installed.packages()[grep('^base$', installed.packages()[, 'Priority']), ]
+2
source

All Articles