Introduction ..................................................................................................................................................................1
1. Starting Up................................................................................................................................................................3
1.1
Getting started under Windows ......................................................................................................................3
1.2
Use of an Editor Script Window .....................................................................................................................4
1.3 A Short R Session............................................................................................................................................5
1.4 Further Notational Details.............................................................................................................................7
1.5 On-line Help....................................................................................................................................................7
1.6 The Loading or Attaching of Datasets...........................................................................................................7
1.7 Exercises..........................................................................................................................................................8
2. An Overview of R.....................................................................................................................................................9
2.1 The Uses of R .......................................................................................................................................................9
2.2 R Objects............................................................................................................................................................11
*2.3 Looping.............................................................................................................................................................12
2.4 Vectors................................................................................................................................................................12
2.5 Data Frames ......................................................................................................................................................15
2.6 Common Useful Functions................................................................................................................................16
2.7 Making Tables....................................................................................................................................................17
2.8 The Search List ..................................................................................................................................................17
2.9 Functions in R....................................................................................................................................................18
2.10 More Detailed Information.............................................................................................................................19
2.11 Exercises...........................................................................................................................................................19
3. Plotting.....................................................................................................................................................................21
3.1 plot () and allied functions................................................................................................................................21
3.2 Fine control – Parameter settings....................................................................................................................21
3.3 Adding points, lines and text.............................................................................................................................22
3.4 Identification and Location on the Figure Region ..........................................................................................24
3.5 Plots that show the distribution of data values................................................................................................25
3.6 Other Useful Plotting Functions.......................................................................................................................27
3.7 Plotting Mathematical Symbols........................................................................................................................29
3.8 Guidelines for Graphs.......................................................................................................................................29
3.9 Exercises.............................................................................................................................................................30
3.10 References........................................................................................................................................................31
4. Lattice graphics......................................................................................................................................................33
4.1 Examples that Present Panels of Scatterplots – Using
xyplot()
..............................................................33
4.2 An incomplete list of lattice Functions.............................................................................................................34
4.3 Exercises.............................................................................................................................................................35
5. Linear (Multiple Regression) Models and Analysis of Variance....................................................................37
5.1 The Model Formula in Straight Line Regression ............................................................................................37