I was trying to have RStudio picked the library location automatically based on R version. I put these lines in either .Renviron or .Rprofile but it didn't work
I was talking about Rprofile.site not .Rprofile but actually a better fit for this would be to set R_LIBS_USER in your Renviron.site file, this file doesn't exist by default but you can create it at $R_HOME/etc/Renviron.site for each R version.