I have a few older R projects I'm working with, which are dependent on several currently deprecated (or heavily modified) packages. In order for everything to work smoothly I use older versions of those packages, which I have saved in another folder and load up manually to
You can solve this much simpler:
.Rprofilewith a single assignment such as
Now when you start R in the different project directories, each will a separate library directory preceding the path, allowing you to place per-projects overrides there.
In an nutshell, the approach outlines here allows you to keep the local and modified packages around as you please. (You can even assign common directories via
.libPaths() if you so choose.)
The nice things is that this will
.Rproffiles -- though you are free to use RStudio as well.
As so often, Base R is there for you.