How do I install "R" on macOS using homebrew?

Install Homebrew (if needed)

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install R

brew tap homebrew/science
brew install r

Assuming you just want to install “R” on OS X and are not interested in homebrew:

Just download the binary from CRAN https://cloud.r-project.org/

  1. Go to http://www.r-project.org/
  2. Click CRAN
  3. Select a mirror
  4. Click "download R for (Mac) OS X"
  5. Download and install the latest pkg binary

See also the R for Mac OSX FAQ that includes information on installation.

Note also the comments below suggesting that homebrew is often not the best option.


After following Matt Burns' answer, you can also install the R.app GUI via brew cask:

$ brew tap caskroom/cask
$ brew cask install r-app
$ open /Applications/R.app

You can download R for Mac OS X simply from here : http://cran.cnr.berkeley.edu

Hit the button : Download R for (Mac) OS X

Install the PKG file that came in the download.

This website might help to go ahead and download home-brew / install home brew as well.

https://github.com/Homebrew/homebrew/wiki/Installation


I'm a fan of RStudio. It's an IDE that wraps R, makes visualization, organization, debugging, and other tasks much easier. Or, you can just use it as if it were a simple install of R. There's a Mac binary available from that website.