Installing R with Homebrew

Installing R with Homebrew

As of 2017, its just brew install r. See @Andrews answer below.

n

As of 2014 (using an Yosemite), the method is the following:

n

brew tap homebrew/sciencenbrew install Caskroom/cask/xquartznbrew install rn

n

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.

n

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

n

In case you dont have XCode Command Line Tools (CLT), run from terminal:

n

xcode-select --installn

As of 2017 / Brew 1.3.2 @ macOS Sierra 10.12.6 all you have to do is:

n

$ brew install rn

n

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

n

It will also install all dependencies automatically:

n

==> Installing dependencies for r: gmp, mpfr, libmpc, isl, gccn

n

There are two additional options you might want to know:

n

--with-javanBuild with java supportn--with-openblasnBuild with openblas supportn

Installing R with Homebrew

I used this tutorial to install R on my mac, and it had me install xquartz and a fortran complier (gfortran) as well.

n

My suggestion would be to brew untap homebrew/science and then brew tap homebrew/science and try again, also, make sure you dont have any errors when you run brew doctor

n

Hope this helps

Leave a Reply

Your email address will not be published.