Reader small image

You're reading from  Learning R Programming

Product typeBook
Published inOct 2016
Reading LevelBeginner
PublisherPackt
ISBN-139781785889776
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Kun Ren
Kun Ren
author image
Kun Ren

Kun Ren has used R for nearly 4 years in quantitative trading, along with C++ and C#, and he has worked very intensively (more than 8-10 hours every day) on useful R packages that the community does not offer yet. He contributes to packages developed by other authors and reports issues to make things work better. He is also a frequent speaker at R conferences in China and has given multiple talks. Kun also has a great social media presence. Additionally, he has substantially contributed to various projects, which is evident from his GitHub account: https://github.com/renkun-ken https://cn.linkedin.com/in/kun-ren-76027530 http://renkun.me/ http://renkun.me/formattable/ http://renkun.me/pipeR/ http://renkun.me/rlist/
Read more about Kun Ren

Right arrow

Installing R


To install R, you need to visit R's official website (https://www.r-project.org/), download R (https://cran.r-project.org/mirrors.html), choose a nearby mirror, and download a version for your operating system. At the time of writing, the latest version is 3.2.3. The examples in this book are created and run under this version in Windows and Linux, but there should not be significant differences between the output in previous versions or other supported operating systems.

If you are using Windows, just download an installer for the latest version. To install R, run the Windows installer that you just downloaded. The installation process is easy to handle, but many users may still face problems with several steps.

In the Windows drop-down, when choosing the components to install, the installer lists four components. Here, Core files means the core libraries of R, and the Message translations component provides many versions of translations of warning and error messages in a list of supported languages. However, what may confuse you is the 32-bit files and 64-bit files options. Just don't worry; you only need to know that 64-bit R can handle much more data in a single process than its 32-bit counterpart. If you are using a modern computer purchased in recent years, it is most likely to support 64-bit programs and should be running a 64-bit operating system, so the default option will be 64-bit files. If you are using a 32-bit operating system, unfortunately, you cannot use 64-bit R unless you install a 64-bit system if your hardware supports it.

Anyway, I recommend that you install the default options, as shown in the following screenshot:

Another option you may feel confused about is whether to save the R version number in the registry. Checking these options makes it easier for other programs to detect which R version is installed. If you are sure you only use R in its own, just go ahead with the defaults.

Then, the installation starts copying files to your hard drive.

Finally, R is deployed to your computer. At the moment, you only have two ways to use R: In a command prompt (or terminal) or in the R GUI.

If you allowed the installer to create program shortcuts on your desktop, you will find two R shortcuts there. R runs in the Command Prompt and RGUI runs in an extremely simple GUI.

Although you can start to use R right now, it does not mean you have to use it in this way. I strongly recommend RStudio for editing and debugging R scripts. Actually, this book is also written in R Markdown in RStudio. Although RStudio is powerful, it does not work without a proper installation of R. In other words, R is the backend and RStudio is a frontend that helps you better work with the backend.

If you are using Windows, you may also install Rtools (http://cran.rstudio.com/bin/windows/Rtools/) so that you can write C++ code, compile it, and call it in R, and you can install and compile packages that contain C/C++ code from their sources.

Previous PageNext Page
You have been reading a chapter from
Learning R Programming
Published in: Oct 2016Publisher: PacktISBN-13: 9781785889776
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Kun Ren

Kun Ren has used R for nearly 4 years in quantitative trading, along with C++ and C#, and he has worked very intensively (more than 8-10 hours every day) on useful R packages that the community does not offer yet. He contributes to packages developed by other authors and reports issues to make things work better. He is also a frequent speaker at R conferences in China and has given multiple talks. Kun also has a great social media presence. Additionally, he has substantially contributed to various projects, which is evident from his GitHub account: https://github.com/renkun-ken https://cn.linkedin.com/in/kun-ren-76027530 http://renkun.me/ http://renkun.me/formattable/ http://renkun.me/pipeR/ http://renkun.me/rlist/
Read more about Kun Ren