Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Installing R with Homebrew

I'm trying to install R using Homebrew. I ran these commands which are recommended elsewhere on SO:
brew tap homebrew/science
brew install R


For brew tap homebrew/science, I'm receiving this error:

Error: Already tapped!


For the second command, I receive this:
Error: No available formula for r 


Any recommendations?
by

2 Answers

vishaljlf39
The method is the following:
brew tap homebrew/science
brew install Caskroom/cask/xquartz
brew install r


The gcc package (will be installed automatically as a required dependency) in the homebrew/science tap already contains the latest fortran compiler (gfortran), and most of all: the whole package is precompiled so it saves you a lot of compilation time.

This answer will also work for El Capitan and Mac OS Sierra.

In case you don't have XCode Command Line Tools (CLT), run from terminal:
xcode-select --install
sandhya6gczb
As of 2017 / Brew 1.3.2 @ macOS Sierra 10.12.6 all you have to do is:

$ brew install r

You don't even need to tap homebrew/science since r is now a part of core formulae for the Homebrew (homebrew-core).

It will also install all dependencies automatically:

==> Installing dependencies for r: gmp, mpfr, libmpc, isl, gcc
There are two additional options you might want to know:

--with-java
Build with java support
--with-openblas
Build with openblas support

Login / Signup to Answer the Question.