Keeping track of your favorite R packages

…if you want to keep track of your favorite packages it is as simple as

pkgs = rownames(installed.packages())
writeLines(pkgs, “packages.txt”)

and you have a list of all packages that you can edit if desired. if you ever want to re-install then simply

pkgs = readLines(“packages.txt”)
install.packages(pkgs)

and if you only want to install missing it’s simply

missing.pkgs = pkgs[!pkgs %in% rownames(installed.packages())]
install.packages(missing.pkgs)

All trivially done in R. It is always beyond me why people come up with incredibly convoluted solutions to simple things ..

From:  Simon Urbanek
Datum: 10. Juni 2021 um 00:26:45 MESZ

This (and many other useful hints and discussions) was published in the R-SIG-Mac (Special Interest Group on Mac ports of R). This list might be used also for bug reports or feature requests on the R application for OS X, see: https://stat.ethz.ch/mailman/listinfo/r-sig-mac