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
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
After enabling the EPEL repository, install R using the yum package manager:
sudo yum install R -y
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.
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.
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://