Installing R with Homebrew

后端 未结 12 655
旧时难觅i
旧时难觅i 2020-12-12 12:35

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
相关标签:
12条回答
  • 2020-12-12 12:53

    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
    
    0 讨论(0)
  • 2020-12-12 12:56

    This is what actually worked for me on OSX Yosemite.

    brew install cask
    brew install Caskroom/cask/xquartz
    brew install r
    
    0 讨论(0)
  • 2020-12-12 12:58

    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
    
    0 讨论(0)
  • 2020-12-12 13:00

    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
    
    0 讨论(0)
  • 2020-12-12 13:03

    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

    0 讨论(0)
  • 2020-12-12 13:07

    Working on El Capitan 10.11.1, the steps I followed are

    brew install cask    
    brew tap homebrew/science    
    brew install r
    
    0 讨论(0)
提交回复
热议问题