syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
How to install R from source?

I encountered a use-case today which required that I run R version 3.1.x

I searched:

http://www.google.com/search?q=how+to+install+r+on+linux

I found:

http://lib.stat.cmu.edu/R/CRAN/

I downloaded:

http://lib.stat.cmu.edu/R/CRAN/src/base/R-3/R-3.1.2.tar.gz

I did untar:
cd ~/Downloads; tar zxf R-3.1.2.tar.gz
I did configure:
mkdir /home/dan/rdir; cd R-3.1.2; ./configure --prefix=/home/dan/rdir
I saw:
configure: error: --with-x=yes (default) and X11 headers/libs are not available
I did configure again:
mkdir /home/dan/rdir; cd R-3.1.2; ./configure --prefix=/home/dan/rdir --with-x=no
I ran 'make' and waited a long time for it to finish:
make
I ran 'make install':
make install
I tried it and it worked:
dan@hp ~ $ 
dan@hp ~ $ 
dan@hp ~ $ /home/dan/rdir/bin/R

R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> 
> 
> 1 + 1.1
[1] 2.1
> 
> 
Save workspace image? [y/n/c]: n
dan@hp ~ $ 
dan@hp ~ $ 
dan@hp ~ $ 


syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me