Hi all, I recently got a new computer (windows) and I am trying to stay on top of my file organization. Upon installing R/Rstudio and installing my first packages: install.packages("dplyr")
and saw the default library installation path was into:
"c:/users/USER/documents/r/..."
Which wasn't ideal. I'd simply like to change the default package installation directory. My initial search made me think that an .Rprofile could set the proper .libPaths()
but more digging lead me to believe .Renviron variables may be the way to go.
Still, some resources recommend changing R_LIBS_USER: Link
Others recommend changing R_LIBS or R_LIBS_SITE: Link
I also looked at the CRAN documents for managing libraries and couldn't really determine benefits one way or the other.
Three main questions:
- What are the main differences between the environment variables?
- Is it wrong to install all packages in the same location, or should base packages be kept in a separate directory?
- Will I have to move directories around when new R versions are installed?
Thanks in advance,
Greg