Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. 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.

  2. 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.

  3. Install required dependencies: Run the command brew install gcc gfortran readline pcre cairo udunits in the Terminal app.

  4. 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.

  5. 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.

  6. 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.

  7. Compile R: Run the command make in the Terminal app to compile R. This may take several minutes to complete.

  8. Install R: Once the compilation is complete, run the command sudo make install in the Terminal app to install R on your system.

  9. 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.