r-package
Add objects to package namespace
Along the line of @Hadley’s solution, but using the environment of the namespace, how about: environment(myfun) <- asNamespace(‘stats’)
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