1Basics of R

This chapter introduces R and describes some of its basic operations and editing procedures. The syntax used to read and edit statistical data and to perform some basic statistical calculations is given.

It is not the intention to provide a complete set of features of the language, but rather to give a flavor of the structure of R and how to get help to proceed further. Additional features are introduced in later chapters as the need for them arises.

1.1 What Is R?

R is a data‐analysis system, a sophisticated calculator and an object‐oriented programming language. It provides an environment for statistical analysis and graphics that differs from standard statistical packages such as SPSS and Minitab; these provide point‐and‐click graphical‐user interfaces (GUIs), while R is command‐driven. Users type commands at a prompt, and the R interpreter responds.

It is possible to get quite far using R to execute simple expressions from the command line, and some users may never need to go beyond this. At a more advanced level, users write their own functions, either to systematize repetitive work or to develop add‐on packages for new functionality.

1.2 Installing R

R is obtained from the website called CRAN (Comprehensive R Archive Network) and is downloaded by proceeding as follows:

  • Go to the CRAN website at http://cran.r-project.org/;
  • Choose an operating system from Linux, (Mac) OS X, and Windows appropriate to your computer. In this book, we work in the Windows environment, ...

Get Probability with R, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.