Skip to main content

Installing R on Ubuntu 19.10


Download R Source code from
https://cran.rstudio.com/index.html

extract the .tar.gz file to a location
gzip -dc R-x.y.z.tar.gz | tar -xf -

current sources for the recommended packages, which can be obtained by rsync or downloaded from CRAN. To use rsync to install the appropriate sources for the recommended packages, run ./tools/rsync-recommended from the top-level directory of the R sources.

Install necessary packages to add repository over HTTPS
sudo apt install apt-transport-https software-properties-common


Add CRAN external repository
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'

edit /etc/apt/sources.list and remove comments for deb-src for line containing cran35/
(mostly last line of this file)

execute sudo apt-get update to read the sources files.

Install package dependencies using
sudo apt-get build-dep r-base

This step will download a tone of dependencies and may take some time

Now navigate to folder where R is extracted and execute
./configure --prefix=/opt/R/3.6.2 --enable-R-shlib --with-blas --with-lapack

This prepares a make file that installs R under /opt
blas enables to use system libraries rather than R internal libraries. It improves analytics calculation speed.

Output should look like something like this


Execute make comment to execute it
make

finally install it by 
sudo make install

you can optionally create a short cut for it using
sudo ln -s /opt/R/3.6.2/bin/R /bin/R



Comments

Popular posts from this blog

Upa Yoga

BIG ONE COMING ?

On July 4 morning, a mild earthquake measuring 4.0 rocked CA at about 10 AM. Personally I didnt experienced it and came to know about it only when another earthquake measuring 6.6 hit. Since moving to CA, it isnt my first earthquake. I experienced few before.  Just like before, googled to see whats going, enjoyed fun in Twitter and continued with my day as usual. Next day evening,  I experienced something bigger.  This one is different from previous ones. It keeps shacking for a while. By 9 PM PT, it's subdued but a ton of questions racing through my mind..  Its night time and we will be in middle of sleep. Will it be safe going in ?  This one is differently bigger than yesterday. Will the next one going to be bigger ? If yes, how soon ? I started searching for answers, but all i can see is " WELCOME TO CA " messages. I am not new to CA and living here for a while. This isn't felt normal. So I started se...