Mac Help (Updated 2018-8-30)
R install notes for Macintosh Users
The following notes are for installing R, Emacs, and RStudio on macOS 10.13.6 (High Sierra). We recommend ensuring that your macOS (Macintosh Operating System) is up-to-date and that you have no software updates pending before following the steps below (you can open the App Store app on your computer and go to Updates; all the MacOS updates are listed there).
R Install Notes for Macintosh Users
With R versions 3.4.0 and newer, the versions of XQuartz, clang, and gfortran required are not provided by Apple. We also suggest installing the latest version of Xcode (available in the App Store). Without clang or gfortran, packages such as Rstan will not compile properly and will be unusable. This page provides a guide for installing R 3.5.1 and its dependencies. It is TOTALLY FINE if you haven't heard about any of these software packages - they usually run behind the scenes. Please just be patient and follow through the steps listed here. You will have a more pleasant R learning experience (we promise).
Step 1 - macOS version check. Click on the apple icon on the top left corner of the desktop, then select "About This Mac". Under the "Overview" you should be able to see the macOS version - please make sure it is the latest.
Step 2 - Download and Install Xcode. Click on the apple icon again, then "App Store...". Once the App Store is open, type "Xcode" in the Search bar located on the top right corner. Download and install Xcode. This will be a large download (5.30 GB when these instructions were written), therefore this step will take a while and please use Ethernet conection if possible.
Step 3 - Agree to Xcode license. Open a "Finder" window, select "Applications", then "Utilities". Locate and double-click open the "Terminal.app" in the "Utilities" folder. Enter the following command (or copy and paste) in the terminal window:
sudo xcodebuild -license
Then, enter "agree" in the terminal window to finish installing Xcode.
Step 4 - Download and Install XQuartz. Go to https://www.xquartz.org/ and download the latest "XQuartz-x.x.xx.dmg" file. Open the .dmg file and double click on the .pkg file to start the installation process. Follow all steps in the installation help window.
Step 5 - Download R. Navigate to https://cran.r-project.org/. Click on "Download R for (Mac) OS X". Download the R-3.5.1.pkg file, but DO NOT open it yet. We want to install all of the dependencies prior to installing R.
Step 6 - Install clang and gfortran.
- Click on the "tools" link in the note for R-3.5.1. We should be able to see the download links for "clang-x.x.x.pkg" and "gfortran-x.x.pkg".
- Download "clang-x.x.x.pkg" and "gfortran-x.x.pkg".
- Install clang and the security warning. Double click the "clang-x.x.x.pkg" file - if you see a warning message stating the software is not from an identified developer, do the following:
- Open "System Preferences".
- Locate and open "Security & Privacy".
- Click on the "Open Anyway" next to the warning message about "clang-x.x.x.pkg".
- Follow (or "Continue") through the "Clang x.x.x Installer" steps to finish installing clang.
- Install gfortran. Double click the "gfortran-x.x.x.pkg" file and follow through the "gfortran-x.x Installer" steps to finish installing gfortran.
Step 7 - Install R and the security warning. Double click the "R-3.5.1.pkg" file (we downloaded this file at Step 5) - if you see a warning message stating the software is not from an identified developer, you should know what to do by now :)
Downloading a User Interface
Once R is installed, we suggest downloading a user interface in which you write your code and run it. Below we provide instructions for Emacs and Rstudio. Rstudio is typically preferred by users new to R, whereas Emacs seems to be more popular among individuals with programming experience.
Emacs install notes for Macintosh users
Applies to: Mac OSX 10.11
We recommend the Emacs install from Vincent Goulet http://vgoulet.act.ulaval.ca/en/home (Note, there may be a newer version).
Locate and double click the downloaded file: Emacs-24.5-1-modified-7.dmg. When the window opens, drag and drop the Emacs icon into the Applications folder.
Browse to your Applications folder and open Emacs.
If a dialog box presents itself asking if you are sure you want to open Emacs, click "Open".
If you get an error that says: "Emacs" is damaged and can't be opened. You should move it to the trash", navigate to the Security and Privacy settings under System Preferences and click: "Allow apps downloaded from: anywhere" (You may have to click the "lock" icon on the bottom left hand corner to type in your password). Then try reopening the Emacs.
RStudio install notes for Macintosh users
Head to https://www.rstudio.com/products/RStudio where you can install a free (open source) version of the desktop software. Download the software.
Double click the download file (.dmg) and drag the RStudio app into the applications folder (as is shown in the Emacs install steps above).