Install Xcode and Command Line Tools: Open the Terminal app and run the command xcode-select --install
. Follow the on-screen instructions to install Command Line Tools.
Install Homebrew: Open the Terminal app and run the command /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
. Follow the on-screen instructions to install Homebrew.
Install required dependencies: Run the command brew install gcc gfortran readline pcre cairo udunits
in the Terminal app.
Download the R source code: Go to the R project website (https://cran.r-project.org/sources.html) and choose the version of R that you want to download. Download the source code (.tar.gz
file) to your desired directory.
Extract the R source code: Open the Terminal app, go to the directory where you downloaded the R source code, and run the command tar xvzf R-x.y.z.tar.gz
, where x.y.z
is the version number.
Configure R: Navigate to the extracted R source code directory in the Terminal app and run the command ./configure --with-readline=no --with-cairo=yes --with-libpng=yes
. This will configure R with the necessary dependencies.
Compile R: Run the command make
in the Terminal app to compile R. This may take several minutes to complete.
Install R: Once the compilation is complete, run the command sudo make install
in the Terminal app to install R on your system.
Verify installation: To verify that R was installed correctly, open the Terminal app and run the command R
to launch the R console. You should see the R prompt (>
) appear in the Terminal app.
Asked: 2022-10-21 11:00:00 +0000
Seen: 14 times
Last updated: Apr 29 '21