Contents
An Elementary Introduction to R 11
Whirlwind Tour of R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Example 1: The Whiteside Insulation Data . . . . . . . . . . . . . . . . . . . . 13Example 2: Cars and Fuel Economy . . . . . . . . . . . . . . . . . . . . . . . 15Example 3: Images of Volcanic Activity . . . . . . . . . . . . . . . . . . . . . 19Example 4: Coastline and Maps . . . . . . . . . . . . . . . . . . . . . . . . . . 19R and the Tinn-R Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21R and the Tinn-R Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Obtaining R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21R Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22R Reference Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22How Does R Work and How Do I Work with it? . . . . . . . . . . . . . . . . 23Installing and Loading R Packages . . . . . . . . . . . . . . . . . . . . . . . . 25Customisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26The
Rprofile.site
file: An Example . . . . . . . . . . . . . . . . . . . . . 27What Editor can I use with R . . . . . . . . . . . . . . . . . . . . . . . . . . . 28The Tinn-R Editor: A Demonstration . . . . . . . . . . . . . . . . . . . . . . . 28The R Language: Basic Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 29The R Language: Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 35The R Language: Missing, Indefinite and Infinite Values . . . . . . . . . . . . 37Distributions and Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 38R Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453