I am running R on Windows, not as an administrator. When I install a package, the following command doesn\'t work:
> install.packages(\"zoo\")
Installing
Since most of the answers here are related to Windows & Mac OS, (and considering that I also struggled with this) I decided to post the process that helped me solve this problem on my Arch Linux setup.
Step 1:
Renviron
(which is the configuration file where the settings for the user libraries are set)./etc/R/
/usr/lib/R/etc/
Renviron
config files stored at 1 & 2 (above) are hot-linked to each other (which means changes made to one file will automatically be applied [ in the same form / structure ] to the other file when the file being edited is saved - [ you also need sudo
rights for saving the file post-edit ] ).Step 2:
/etc/R/
) and open the Renviron
file with your favourite text editor.Renviron
file search for the R_LIBS_USER
tag and update the text in the curly braces section to your desired directory path. R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/4.0'}
R_LIBS_USER=${R_LIBS_USER-'~/Apps/R/rUserLibs'}
Step 3:
Renviron
file you've just edited ... DONE !!