How to Install R Studio

How to Install R Studio ?

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

  1. Go to the CRAN website.
  2. Click on Download R for Windows.
  3. Select base.
  4. Click on the link to download the latest version of R (e.g., Download R 4.3.2 for Windows).

Step 2: Install R

  1. Open the downloaded .exe file.
  2. Follow the installation prompts. Use the default settings unless you have specific requirements.
  3. Once installed, R will be available in your Start Menu.

Step 3: Download RStudio for Windows

  1. Go to the RStudio download page.
  2. Under Installers for Supported Platforms, click on Download RStudio for Windows.

Step 4: Install RStudio

  1. Open the downloaded .exe file.
  2. Follow the installation prompts. Use the default settings.
  3. Launch RStudio from the Start Menu.

Installation on macOS

Step 1: Download R for macOS

  1. Go to the CRAN website.
  2. Click on Download R for (Mac) OS X.
  3. Select the latest .pkg file for your macOS version (e.g., R-4.3.2.pkg).

Step 2: Install R

  1. Open the downloaded .pkg file.
  2. Follow the installation prompts. Use the default settings.
  3. R will be installed in the Applications folder.

Step 3: Download RStudio for macOS

  1. Go to the RStudio download page.
  2. Under Installers for Supported Platforms, click on Download RStudio for Mac.

Step 4: Install RStudio

  1. Open the downloaded .dmg file.
  2. Drag the RStudio icon to the Applications folder.
  3. Launch RStudio from the Applications folder.

Installation on Edubuntu Linux

Step 1: Install R via Terminal

  1. Open the Terminal.
  2. 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/'
                    
  3. Update your package list:
    
    sudo apt update
                    
  4. Install R:
    
    sudo apt install r-base
                    

Step 2: Download RStudio for Linux

  1. Go to the RStudio download page.
  2. Under Installers for Supported Platforms, select the Debian/Ubuntu version (e.g., rstudio-2023.12.1-402-amd64.deb).

Step 3: Install RStudio

  1. Open the Terminal and navigate to the directory where the .deb file is downloaded.
  2. Install RStudio using dpkg:
    
    sudo dpkg -i rstudio-2023.12.1-402-amd64.deb
                    
  3. Fix any dependencies:
    
    sudo apt --fix-broken install
                    
  4. Launch RStudio from the Applications Menu or by typing rstudio in 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.

Educational Resources Footer