Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Get the R source from https://cran.r-project.org/ under "R source" link on the left panel.

    Code Block
    languagebash
    firstline1
    titleDownload R source on Ubuntu
    linenumberstrue
    $ wget https://cran.r-project.org/src/base/R-3/R-3.5.0.tar.gz


  • Unpack the zip file:

    Code Block
    languagebash
    firstline1
    titleUnzip
    linenumberstrue
    $ tar -xf R-3.5.0.tar.gz


  • Compile the source code:

    Code Block
    languagebash
    firstline1
    titleCompile
    linenumberstrue
    ./configure
    make


  • Then check the built system works correctly by

    Code Block
    languagebash
    firstline1
    titlecheck
    linenumberstrue
    make check


  • Then install

    Code Block
    languagebash
    firstline1
    titleinstall
    linenumberstrue
    sudo make install rhome=/usr/local/R/R-3.5.0


  • Make link for R <major>.<minor> 

    Code Block
    languagebash
    firstline1
    titlemake link
    linenumberstrue
    sudo ln -s R-3.5.0 R-3.5


  • Update the alternatives for R:

    Code Block
    languagebash
    firstline1
    titleupdate alternatives
    linenumberstrue
    sudo update-alternatives --install /usr/bin/R R /usr/local/R/R-3.5/bin/R 50 --slave /usr/bin/Rscript Rscript /usr/local/R/R-3.5/bin/Rscript
    sudo update-alternatives --set R /usr/local/R/R-3.5/bin/R
    
    # to view all alternatives
    update-alternatives --config R
    
    # to fix broken links
    yes '' | sudo update-alternatives --force --all


Mac Instructions


Windows Instructions