Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Modern R Programming Cookbook

You're reading from   Modern R Programming Cookbook Recipes to simplify your statistical applications

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781787129054
Length 236 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Jaynal Abedin Jaynal Abedin
Author Profile Icon Jaynal Abedin
Jaynal Abedin
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Installing and Configuring R and its Libraries FREE CHAPTER 2. Data Structures in R 3. Writing Customized Functions 4. Conditional and Iterative Operations 5. R Objects and Classes 6. Querying, Filtering, and Summarizing 7. R for Text Processing 8. R and Databases 9. Parallel Processing in R

Installing and configuring base R in Linux

It is not necessarily the case that every user will use Windows platform. In this recipe, you will see how to install and configure R on the Linux platform. Each of the steps is described with an appropriate screenshot so that you can easily understand the steps.

Getting ready

To install R in the Linux operating system, first, you need to know the version of Linux you are using. To know the version of Linux installed on your computer, there are many options. One of the options is the following command:

lsb_release -a

This command will give the release information as shown in the following screenshot:

In this recipe, you will see the example from the Ubuntu 14.04 release.

How to do it...

Once you have the version number, you simply need to install base R onto your computer. The step-by-step procedure is as follows:

  1. Update etc/apt/source.list by adding an entry as follows:
        deb <cran mirror address>/bin/linux/ubuntu trusty/
  1. Replace <cran mirror address> by putting an actual mirror link from the list of available mirrors from https://cran.r-project.org/mirrors.html. Remember that you must have administrator privileges to edit etc/apt/source.list.
  2. Once you have performed the preceding step, type the following command to install R:
      sudo apt-get update
sudo apt-get install r-base
  1. The preceding two commands will complete the installation process and you can check whether R has been installed correctly or not, by typing R and hitting Enter on the Terminal window. If the R console opens, then you are ready to go:
  1. Some of the users may need to compile R packages from the source code. In that case, you will need to install the following component of R:
      sudo apt-get install r-base-dev
Your computer must connect to the internet to install R.

There's more...

In this recipe, you have installed base R into Ubuntu 14.04 release. If your operating system has another release of Linux, then visit https://cran.r-project.org/, select Download R for Linux, and follow the steps outlined there.

See also

To understand how to install an IDE into either Windows or Linux, follow the next recipe.

You have been reading a chapter from
Modern R Programming Cookbook
Published in: Oct 2017
Publisher: Packt
ISBN-13: 9781787129054
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.
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 €18.99/month. Cancel anytime