Install homebrew if it's not already installed on your Mac. Open Terminal and run the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homeb…)"
Once homebrew is installed, use it to install R by running this command in Terminal:
brew install r
Check which versions of R are available to install by running:
brew search r
Choose the version of R you want to install (say version 3.5.3) and run:
brew install r@3.5.3
You can now use this version of R in Terminal by typing:
R-3.5.3
To switch to a different version of R, run:
brew unlink r && brew link r@VERSION
Replace "VERSION" with the version number you want to use, such as:
brew unlink r && brew link r@3.6.3
This will switch to version 3.6.3 of R.
Note: You may need to install packages separately for each version of R you install. The packages you install for one version of R will not be available in other versions. To avoid conflicts, it's recommended to use separate R libraries for each version of R. You can create a library specific to a version of R by running this command in R:
.libPaths("/path/to/new/library")
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-07-19 09:18:47 +0000
Seen: 12 times
Last updated: Jul 19 '23
How can I uninstall Gatsby/Gatsby-Cli that were previously installed using brew?
How can the installed version of the R source package be recreated/rebuilt?
What is the proper way to substitute numpy version 1.24.2 with 1.23.5?
How can TensorRT be installed for TensorFlow on a GPU?
Cannot locate node during React Native ios build.
What is the process for choosing which version to install when using dnf in Rhel 8?
How to specify a particular version of NuGet during the publishing process?
How would you reword the question regarding creating a pointer version of strcat?
What is the issue encountered when attempting to update pip packages?