GNU R – Installation and First Steps

You will notice during all my installations, I’m preferring a Linux distribution – CentOS. All the configuration can be done on all those other ones, it is just historical, that I’m quite used CentOS. I’m aware of all the Pros and Cons – it depends on your personal preference, shouldn’t be a big deal to configure this on Debian, Ubuntu, SuSe, and all those others. in most cases it is just done by replacing yum by the package manager commands of the distribution of your choice.

In ancient times software installation was time consuming, maybe some of you are recalling those „configure; make; make install“ sequences – finding out – some library is missing, some include file as well. Took eventually days to get a simple piece of software up and running – gave you a very detailed insight how all of this is working – but the price – your time. With the actual package based distributions those installations can be done in minutes – literally.

Some words on the general design. We’ll build during this series of articles:

  • The nginx layer to take care of SSL offloading, and the forwarding to involved systems
  • RStudio and Shiny (we’ll come later to this one)
  • Database setup (based on MariaDB)
  • gitlab server
  • GoCD

I’ve got a quite large ESXi server, where I’m running all those instances as dedicated containers. All of this could be done on one single box, but I like to separate those. Especially as I’ve had some experience when e.g. the update requirements for one system conflicts with the another one. As CentOS is free, and you only need round about 8 GB per instance plus some storage – it is not a big deal to separate that.

Ok – on a standard installed CentOS we’ll start with the first step.

Install GNU R

As this is part of the standard CentOS distribution – this is a no-brainer.

By using the magic command

# yum install R

CentOS will start to check for all the required packages – don’t be surprised, it it ends up with over 50 packages consisting of several hundred megabytes – GNU R is huge, and requires a lot of add packages (remember my comment on the „configure; make; make install“ cycles 🙂 )

Depending on internet access and the performance of your system this will take a while.

After completion of the installation cycle, just enter the simple command „R“.

# R

R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

As always – please create a non-privileged user to develop your code. It is alluring to use the root user – we all know.

At this stage you can do some testing and fiddling around, but a pure text based interface is .. kind of boring with the sixties feeling of a terminal interface.

There are quite a lot of tutorials (should be replace by „huge amount“ or „incredible amount“) available – the R primer is a good example, but if you enter „R tutorial“ or „R examples“ – you’ll get a lot of results.

This site (sponsored by lots of ad links) gives a good introduction (I’m not affiliated with them) – but there are many, many others. And – always a good idea – just buy some books on R coding.

https://www.tutorialspoint.com/r/index.htm

But we shouldn’t spend too much time on the text interface – next step – RStudio – this will make your life as R coder much, much easier.