You might wish to install RStudio after you have installed R. RStudio is a development environment for R that simplifies many programming tasks.
Visual Studio (starting from version 2015 Update 3) now features a development environment for R called R Tools, that includes a live interpreter, IntelliSense, and a debugging module. If you choose this method, you won't have to install R as specified in the following section.
(0. Ensure XQuartz is installed )
This will install both R and the R-MacGUI. It will put the GUI in the /Applications/ Folder as R.app where it can either be double-clicked or dragged to the Doc. When a new version is released, the (re)-installation process will overwrite R.app but prior major versions of R will be maintained. The actual R code will be in the /Library/Frameworks/R.Framework/Versions/ directory. Using R within RStudio is also possible and would be using the same R code with a different GUI.
brew install R
Those choosing the second method should be aware that the maintainer of the Mac fork advises against it, and will not respond to questions about difficulties on the R-SIG-Mac Mailing List.
You can get the version of R corresponding to your distro via
apt-get. However, this version will frequently be quite far behind the most recent version available on CRAN. You can add CRAN to your list of recognized "sources".
sudo apt-get install r-base
You can get a more recent version directly from CRAN by adding CRAN to your sources list. Follow the directions from CRAN for more details. Note in particular the need to also execute this so that you can use
install.packages(). Linux packages are usually distributed as source files and need compilation:
sudo apt-get install r-base-dev
sudo dnf install R
R is directly available in the
Extra package repo.
sudo pacman -S r
More info on using R under Archlinux can be found on the ArchWiki R page.