Step 1: Update the System

Before installing any new software, it’s essential to ensure that your system is up to date. Run the following command to update your system packages:
sudo yum update -y

Step 2: Enable the EPEL Repository

The Extra Packages for Enterprise Linux (EPEL) repository contains additional packages, including R, that are not available in the default repository. Enable the EPEL repository with the following command:
sudo amazon-linux-extras install epel -y

Step 3: Install R

After enabling the EPEL repository, install R using the yum package manager:
sudo yum install R -y

Step 4: Verify Installation

Once the installation is complete, verify that R has been successfully installed by running:
R --version

This command should output the installed R version, confirming that the installation was successful.

Step 5: Start the R Console

To start using R, launch the R console by typing:
R

This command will start the interactive R console, allowing you to write and execute R code.

Optional: Installing RStudio Server (Web-Based R IDE)

For a more feature-rich, web-based R development environment, you can install RStudio Server. Follow the steps below to install and configure RStudio Server:

Step 1: Download RStudio Server
Download the RStudio Server installation package using the wget command:
sudo yum install wget -y

wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.2.5019-x86_64.rpm

Step 2: Install RStudio Server
Install the downloaded RStudio Server package:
sudo yum install --nogpgcheck rstudio-server-rhel-1.2.5019-x86_64.rpm

Step 3: Start RStudio Server
Start the RStudio Server service:
sudo rstudio-server start

Step 4: Access RStudio Server
You can access RStudio Server by navigating to http://:8787 in your web browser. You will be prompted to log in with your Cloud9 credentials.

Support On Demand!

Cloud