Switching Between R Versions on Mac
You can have multiple versions of R on your machine. To see all of them, go to the terminal and type:
ls -l /Library/Frameworks/R.framework/Versions/
Notice that there is a symbolic link which equates the directory called 3.6 with the symbolic link called Current. Symbolic links are shortcults or aliases that point to files or directories.
RStudio uses the symbolic link called Current to know which version of R you want to run.
If you have multiple installed versions of R you can swap between them by doing the following steps. To start using version 4.0 do this:
- Go to the folder with all your versions of R
cd /Library/Frameworks/R.framework/Versions/
- Remove the current symbolic link
rm Current
- Make a symbolic link pointing at version of R
ln -s 4.0 Current
If you wanto to switch back to 3.6 follow the same steps but change the symbolic link bac to 3.6:
- Go to the folder with all your versions of R
cd /Library/Frameworks/R.framework/Versions/
- Remove the current symbolic link
rm Current
- Make a symbolic link pointing at version of R
ln -s 4.0 Current
PS If you are changing to a new version of R, check this post: https://www.r-bloggers.com/upgrade-r-without-losing-your-packages/