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 suggestions?
To install R on a Mac, click the “Download R for Mac” link. Next, click on the R-3.0. 3 package link (or the package link for the most current release of R). An installer will download to guide you through the installation process, which is very easy.
Go into R, click on Packages (at the top of the R console), then click on "Install package(s) from local zip files", then find the zip file with arm from wherever you just saved it. Do the same thing to install each of the other packages you want to install.
The typical installation will install the GUI into the /Applications/R. app folder and the R framework into the /Library/Frameworks/R. framework folder.
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
As of 2017, it's just brew install r
. See @Andrew's answer below.
As of 2014 (using an Yosemite), 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With