class: center, middle, inverse, title-slide # Installing R ## RStudio Team admin training ### Andrie de Vries ### 2020-04-30 --- ## In this session * Understand the different mechanisms for installing R * Installing R from source and pre-compiled binaries --- class:subtitle-slide ## Three mechanisms for installing R --- ### Three mechanisms You have three different mechanisms for installing R on a Linux machine: * Install from a Linux package manager * For example `yum` on Red Hat or `apt` on Ubuntu * Compile from source * Download the R source code and compile using the relevant GCC compiler * Install from pre-compiled binaries provided by RStudio * Download an install the pre-compiled binaries available from RStudio --- ### Method 1: Installing R using yum or apt Installing from `yum` or `apt` (or similar) is traditionally the mechanism that most administrators would use. .alert[ However, updating the R installation will overwrite previous installations. ] For data science work in production, it is important to provide code stability by installing multiple versions of R side-by-side. This means that using your Linux package manager for installing R in production is not a good idea. .alert[ We recommend you don't use a Linux package manager to install R. ] --- ### Method 2: Compile R from source For data science work in production, it is important to provide code stability by installing multiple versions of R side-by-side. You can achieve this by installing R from source. * Download the source code * Create a make configuration * Run `make` * Run `make` install This offers maximum flexibility, because you can specify the location of the installed package and you can optimize for your hardware. <a href='https://docs.rstudio.com/resources/install-r-source/' target='_blank'>Instructions for installing R from source</a> The downside of installing R from source is that it takes some time for the compilation to complete. --- ### Method 3: Install from pre-compiled binaries RStudio recommends that in most cases you install R from pre-compiled binaries. This gives you the benefit of: * Side-by-side installation of multiple versions of R * It is quick, since the compilation step has previously been completed To install from pre-compiled binaries, follow the instructions at <a href='https://docs.rstudio.com/resources/install-r/' target='_blank'>Install R</a> .alert[ This is the recommended option in most cases ] --- class: subtitle-slide ## Summary --- ### Recommendation Our suggested order for making a choice of R installation is: 1. Install from <a href='https://docs.rstudio.com/resources/install-r/' target='_blank'>pre-compiled binaries</a> * to get multiple R versions side-by-side 2. Compile from source * gives more flexibility but takes longer 3. Use `yum` or `apt` * Does not allow side-by-side install * Do not use for long-term data science stability --- class: subtitle-slide name: your-turn ## Your turn --- class: your-turn-slide ### Your turn Next complete the exercise. Signs of success: * R is running