R Installation

Without setting the environment it won't be possible for you to write or develop R programming based applications. So for this, you need to know how to set up your environment to do R programming. In this chapter you will learn about this.

To start learning R programming, you only need to install the R compiler in your System.

Installing R

If you are using a Linux system, then it is possible that your package manager should have R available within, though perhaps not the latest version. For every person else, for installing R you must have to go to http://www.r-project.org first. Do not get deceived by the slightly outmoded website; it does not reflect on the quality of R. Click the link which says "download R" within the "Getting Started" pane at the foot of that page.

Once you have selected a mirror close to you, choose a link within the "Download and Install R" pane at the peak of the page (according to your operating system). After that there is 1 or 2 Operating System specific clicks which you must have to make to get to the download.

If you are a Windows user who does not usually like clicking, there is a naughty shortcut for getting the setup file at one go. Just go to http://<CRAN MIRROR>/bin/windows/base/release.htm and if you are smart enough it search it based on your choice then go to: https://cran.r-project.org/bin/windows/base/ , and save it in the local disk.

R is compiles and runs on a wide variety of UNIX platforms, Windows and Mac OS.

For Windows Users

When it is a Windows installer i.e. having .exe as extension; having name "R-version-win.exe", you can just double click and run the installer allowing the default settings. If you are having Windows as 32-bit version, it installs the 32-bit version. But if you are having windows as 64-bit, then it will install 32-bit and 64-bit versions both.

For Linux Users

If you are a Linux user, then there is a fast and easy command used in Linux which can be used to install R. The yum command is used for installing like this:

$ yum install R

For Ubuntu Linux or other Debian-related OSs, a more direct method is:

$ apt-get install r-base

Choosing Proper IDE

If you are thinking of using R under Windows or Mac OS, then many graphical user interface (GUI) are available which will be having a command-line interpreter that facilities displaying plots and help pages and a fundamental text editor also. It is perfectly achievable to use R in this way, but for serious coding you will have to least want to use a more powerful text editor. There are numerous text editors for programmers.
R studio is one of the popular R-programming specific IDE frequently used IDE for R. Another is Emacs + ESS. Although Emacs call itself as text editor, but 36 years (still developing) of development have positioned itself with an unparalleled number of features. It can be available from http://www.gnu.org/software/emacs/.

Subscribe Updates via Email

Join 49,000+ W3schools lovers and get all the latest tutorials, programs, algorithms in your inbox.