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

Investing in Gold

Like many, I keep hearing about looming recession and Gold as a hedge. But how exactly gold is going to help me and if yes, how to invest is something running behind my mind.  So here is my work on it and hope it helps you too. Why Invest in Gold ?  Fiat currency we are holding is loosing its value at the rate of inflation. But before fiat currency, gold is the standard. Based on current technology, its difficult to extract gold. so in the demand vs supply equation, supply cant balloon like central banks printing money at their will. so i dont need to worry about Gold loosing its value over time. On Supply part, As per World Gold Council estimate 190,040 metric tones extracted and another 54000 metric can be extracted from ground. Refer :  https://www.gold.org/about-gold/gold-supply/gold-mining/how-much-gold On the Demand part, Below are the key drivers of Gold demand Source: Thomson Reuters GFMS, World Gold Council As an investment, From individu...

Upa Yoga

Pakistan

Watching recent tweets and news article in western media, I would like to spend some quality time and understand the enmity between India and Pakistan. In this pursuit, some interesting reads and my take a ways India-Pakistan partition - Birth of a country based on religion  Subsequent incidents Current states 9/11 Terrorist attacks and Intelligence war What wrong with Islam State of Pakistan and reasons for some of its troubles by a Pakistani 10-September - 2019 Pakistan Army begins operation in POK