O'Reilly logo

25 Recipes for Getting Started with R by Paul Teetor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. The Recipes

1.1. Downloading and Installing R

Problem

You want to install R on your computer.

Solution

Windows and OS X users can download R from CRAN, the Comprehensive R Archive Network. Linux and Unix users can install R packages using their package management tool.

Windows
  • Open http://www.r-project.org/ in your browser.

  • Click on “CRAN”. You’ll see a list of mirror sites, organized by country.

  • Select a site near you.

  • Click on “Windows” under “Download and Install R”.

  • Click on “base”.

  • Click on the link to download the latest version of R (an .exe file).

  • When the download completes, double-click the .exe file and answer the usual questions.

OS X
  • Open http://www.r-project.org/ in your browser.

  • Click on “CRAN”. You’ll see a list of mirror sites, organized by country.

  • Select a site near you.

  • Click on “MacOS X”.

  • Click on the .pkg file for the latest version of R, under “Files:”, to download it.

  • When the download completes, double-click the .pkg file and answer the usual questions.

Linux or Unix

The major Linux distributions have packages for installing R. Here are some examples:

DistributionPackage name
Ubuntu or Debianr-base
Red Hat or FedoraR.i386
SuseR-base

Use the system’s package manager to download and install the package. Normally, you will need the root password or sudo privileges; otherwise, ask a system administrator to perform the installation.

Discussion

Installing R on Windows or OS X is straightforward because there are prebuilt binaries for those platforms. You need only follow the preceding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required