When you try to install a package in R and you don't have access rights to the default library path, R will ask you:
Would you like to use a personal library instead?
Would you like to create a personal library '~/path' to install packages into?
However, if you are running an Rscript, those messages will not show up and installation will fail. I could predefine a specific path and instruct install.packages
to use it, but I don't want to create an additional library path that would be specific to this Rscript. I just want to use the default personal library. Is there a way to force creation of a personal library without requiring interaction?