By default, R looks for a .Renviron file in the home directory (as explained e.g. here: https://stackoverflow.com/a/43785071).
In that .Renviron file, a custom package installation directory can be specified with R_LIBS_USER=/some/path
.
Can I pass a custom .Renviron file to an CLI R session, i.e. something like below?
R --environment=/my/custom/folder/.Renviron
or
Rscript --environment=/my/custom/folder/.Renviron
to overwrite ~/.Renviron
(or if there's no .Renviron in the home directory at all).