Installation of R and RStudio
Introduction
Before you can start using R for data analysis, you need to install both R (the programming language) and RStudio (a popular integrated development environment for R). This guide provides step-by-step instructions for installing R and RStudio on Windows, macOS, and Edubuntu Linux.
Installation on Windows
Step 1: Download R for Windows
- Go to the CRAN website.
- Click on Download R for Windows.
- Select base.
- Click on the link to download the latest version of R (e.g., Download R 4.3.2 for Windows).
Step 2: Install R
- Open the downloaded
.exefile. - Follow the installation prompts. Use the default settings unless you have specific requirements.
- Once installed, R will be available in your Start Menu.
Step 3: Download RStudio for Windows
- Go to the RStudio download page.
- Under Installers for Supported Platforms, click on Download RStudio for Windows.
Step 4: Install RStudio
- Open the downloaded
.exefile. - Follow the installation prompts. Use the default settings.
- Launch RStudio from the Start Menu.
Installation on macOS
Step 1: Download R for macOS
- Go to the CRAN website.
- Click on Download R for (Mac) OS X.
- Select the latest
.pkgfile for your macOS version (e.g., R-4.3.2.pkg).
Step 2: Install R
- Open the downloaded
.pkgfile. - Follow the installation prompts. Use the default settings.
- R will be installed in the Applications folder.
Step 3: Download RStudio for macOS
- Go to the RStudio download page.
- Under Installers for Supported Platforms, click on Download RStudio for Mac.
Step 4: Install RStudio
- Open the downloaded
.dmgfile. - Drag the RStudio icon to the Applications folder.
- Launch RStudio from the Applications folder.
Installation on Edubuntu Linux
Step 1: Install R via Terminal
- Open the Terminal.
- Add the CRAN repository to your sources list:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' - Update your package list:
sudo apt update - Install R:
sudo apt install r-base
Step 2: Download RStudio for Linux
- Go to the RStudio download page.
- Under Installers for Supported Platforms, select the Debian/Ubuntu version (e.g.,
rstudio-2023.12.1-402-amd64.deb).
Step 3: Install RStudio
- Open the Terminal and navigate to the directory where the
.debfile is downloaded. - Install RStudio using
dpkg:sudo dpkg -i rstudio-2023.12.1-402-amd64.deb - Fix any dependencies:
sudo apt --fix-broken install - Launch RStudio from the Applications Menu or by typing
rstudioin the terminal.
Verify Installation
After installing R and RStudio, verify the installation by opening RStudio and running the following command in the console:
print("Hello, R!")
If you see the output [1] "Hello, R!", your installation is successful.

