To answer, I have to give a bit of context.
For the purposes of reproduceability, I try to script things, including my entire R setup. I have a script "initializeR.r" that, among other things, installs packages, and I've arranged packages in bundles, such as those relating to cacheing, those relating to visualization, sampling, spatial stats, etc. - my own little task views, if you will.
For instance, here is a snippet:
# Profiling & testing
Packages$CodingTools = c("codetools","debug", "profr","proftools","RUnit")
I combine some of the bundles into a "Major" packages (or primary) list and others go into the "Secondary" list. I am sure to install everything on the primary list - these are needed to have a reasonable R environment, to use my own scripts, functions, and packages, etc. (Btw, some packages are assigned to multiple bundles, but only a few; I de-dupe before processing an aggregated list.)
I then specify a platform specific default library, and install to there. However, this capability is extensible and this idea can be extended to include optional locations for each package bundle (or package): just map from bundle name, e.g. "CodingTools" to a unique directory (library path), say "D:/R/Library/CodingTools". This can be done in the initialization script, with matching lists & default options, or the locations could be stored elsewhere, such as a hash table, JSON, or a database.
As others have said, the default library paths need to be communicated to R. That can be done in .RProfile.site. In my case, I have another script that is used to initialize the R instance as I'd like it. I try to avoid external parameter files that are read by R (e.g. .Rprofile), and instead do all initializations via function calls in my own package (though the parameters are still external). This tends to make it easier for me to debug and reproduce my work. So, my library paths can be included in the same kind of JSON where my data file locations are specified.
Personally, I want to get away from defining the bundles inside the script and instead use JSON, as I can more easily create different JSON files for different setup configurations. I already do this for most other purposes of reproducible work.