You can download the appropriate version by visiting the official R website.
Here are the steps provided for three different operating systems. We have considered Windows, Linux, and Mac OS for R installation. Download the latest version of R as it will have all the latest patches and resolutions to the past bugs.
For Windows, follow the given steps:
Navigate to www.r-project.org.
Click on the CRAN section, select CRAN mirror, and select your Windows OS (stick to Linux; Hadoop is almost always used in a Linux environment).
Download the latest R version from the mirror.
Execute the downloaded
.exe
to install R.
For Linux-Ubuntu, follow the given steps:
Navigate to www.r-project.org.
Click on the CRAN section, select CRAN mirror, and select your OS.
In the
/etc/apt/sources.list
file, add the CRAN<mirror>
entry.Download and update the package lists from the repositories using the
sudo apt-get update
command.Install R system using the
sudo apt-get install r-base
command.
For Linux-RHEL/CentOS, follow the given steps:
Navigate to www.r-project.org.
Click on CRAN, select CRAN mirror, and select Red Hat OS.
Download the
R-*core-*.rpm
file.Install the
.rpm
package using therpm -ivh R-*core-*.rpm
command.Install R system using
sudo yum install R
.
For Mac, follow the given steps:
Navigate to www.r-project.org.
Click on CRAN, select CRAN mirror, and select your OS.
Download the following files:
pkg
,gfortran-*.dmg
, andtcltk-*.dmg
.Install the
R-*.pkg
file.Then, install the
gfortran-*.dmg
andtcltk-*.dmg
files.
After installing the base R package, it is advisable to install RStudio, which is a powerful and intuitive Integrated Development Environment (IDE) for R.