Installing R and RStudio



About R and RStudio

R is a software environment for statistical computing. R is completely free and is available for Windows, Mac and Linux.

RStudio is a graphical interface for R, with several windows and buttons, that can help you work more efficiently.

Frequently asked questions about R on different platforms can be accessed through the following links:


Uninstalling R in Windows, Mac, Linux

The current version of R (Sep 2021) is 4.1.1. If you already have a version of R installed that is not at least R 4.0 I strongly recommend that you remove it before installing a new version. I'll briefly describe how to remove R on different operating systems. These instructions might not suit your version of OS perfectly, so for more details you can visit the links mentioned above.

Windows

Go to the Control Panel and choose "Add/Remove Programs" (Windows XP) or "Programs and Features" (Windows Vista/7/10), locate R and remove it. An alternative is to look for the R folder that is part of the programs that appear in the Start Menu. Inside this folder there should be a link to Uninstall R.

Mac OS X

Open a Terminal (Applications / Utilities / Terminal) and in it type:

sudo rm -rf /Library/Frameworks/R.framework /Applications/R.app
you will need to provide your password.

Linux

Open a Terminal and type:

sudo apt-get --purge remove r-base r-base-dev
you will need to provide your password.


Installing R

Go to this website and choose one of the mirrors:

http://cran.r-project.org/mirrors.html

In the "Download and Install R" section, choose the link for Linux, MacOS X or Windows accordingly.

Windows

Click on base and download and install using the first link: Download R #.##.# for Windows

Mac OS X

In the Latest release: section, download and install the first file: R-#.##.#.pkg

Linux

Choose the distribution that you're using and follow the instructions... good luck! ;o)
Note: be sure to also install r-base-dev

Example in Ubuntu using apt-get

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
sudo apt-get update
sudo apt-get install r-base r-base-dev


Installing RStudio

Installing RStudio should be much easier. Simply download the appropriate installer for your operating system from:

Download RStudio Desktop

and follow the instructions.