I have installed R4.5 in ubuntu, foillowed by Rstudio. I have the following questions:
- I ran the command in the terminal:
sudo gedit /etc/apt/sources.list
and then added the following:
deb Ubuntu Packages For R - Brief Instructions noble-cran40/
I would like to know what cran40 stands for. Should I change it to cran45 for R4.5?
2. In Rstudio, I get the following:
.libPaths()
[1] "/usr/lib/R/library" "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
I would like to know the reason for the 2nd and 3rd locations with site-library? Is there any purpose for them? To change this, I included the following line:
.libPaths(c("/home/rvi/Rlib","/usr/lib/R/library" ))
I ran the command in the terminal:
sudo gedit /usr/lib/R/etc/Rprofile.site
I would first like to know if this is the right file where I should make this change? Or, should it be on a Rprofile.site elsewhere?
The reason I want to make a change to .libPaths is that I want to save my choice of R packages to a folder which I can manage and retain even after I upgrade R to the next version? I do not know if I can do this with the site-library locations.
- I want to add the following to the Rprofile.site:
options(repos = c(Posit =
"https://packagemanager.posit.co/cran/__linux__/noble/latest"))
Have I got it right? Once again, I tried to save this to the Rprofile.site indicated above. I have not succeeded in getting R and Rstudio to accept this. What is wrong in my method?