Installing R with Homebrew

2019-01-21 00:11发布

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?

标签: r homebrew
12条回答
对你真心纯属浪费
2楼-- · 2019-01-21 00:46

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

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

Hope this helps

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-01-21 00:46

This is what actually worked for me on OSX Yosemite.

brew install cask
brew install Caskroom/cask/xquartz
brew install r
查看更多
Deceive 欺骗
4楼-- · 2019-01-21 00:47

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
查看更多
何必那么认真
5楼-- · 2019-01-21 00:51

If you run

xcode-select --install

you do you not need to install gcc through brew, and you will not have to waste time compiling gcc. See https://stackoverflow.com/a/24967219/2668545 for more details.

After that, you can simply do

brew tap homebrew/science
brew install Caskroom/cask/xquartz
brew install r
查看更多
小情绪 Triste *
6楼-- · 2019-01-21 00:51

I am working MacOS 10.10. I have updated gcc to version 4.9 to make it work.

brew update
brew install gcc
brew reinstall r
查看更多
我欲成王,谁敢阻挡
7楼-- · 2019-01-21 00:54
brew install homebrew/science/r

works on OS X 10.11.6.

查看更多
登录 后发表回答