ABSTRACT

The goal of this chapter is to introduce the reader to the programming tools that will be used in subsequent chapters. It therefore provides a highly selective review of R programming.

Users who have some exposure to data analysis and statistical packages that provide graphical user interfaces may be wary about such a seemingly bare-bones introduction to R. Many other data analysis products provide apparently straightforward importation of data, accompanied by attractive graphics and automated model fitting. Why is it useful to dig about in the tissue of the language? The reason is that, in our experience as statisticians, the provision to the analyst of data that are clean and ready to analyze is the exception rather than the rule. Invariably some pre-analysis processing is required. R provides a very flexible and powerful set of tools for the manipulation of data. Careful use of these tools will both ease the process and improve the transparency of preparing the data for suitable analysis. Therefore, close examination of the data manipulation facilities of R will benefit the analyst.