How to load packages in R automatically?

Put library(foo) in your .Rprofile file or set R_DEFAULT_PACKAGES: see ?Rprofile … In particular (because ?Rprofile is long and potentially intimidating): If you want a different set of packages than the default ones when you start, insert a call to ‘options’ in the ‘.Rprofile’ or ‘Rprofile.site’ file. For example, ‘options(defaultPackages = character())’ will attach no … Read more