vi Contents
1.16.13 Simple Graphs to a Graphics Window ..............................................20
1.16.14 Addressing Entries of an Array ......................................................... 20
1.16.15 Example: Salinity ..............................................................................22
1.16.16 CSV Text Files ...................................................................................23
1.16.17 Store Your Data Files and Objects ....................................................24
1.16.18 Command History and Long Sequences of Commands ...................25
1.16.19 Editing Data in Objects .....................................................................25
1.16.20 Cleanup and Close R Session ............................................................26
1.16.21 Computer Exercises ........................................................................... 26
Supplementary Reading .............................................................................................27
Chapter 2 Probability Theory .....................................................................................................29
2.1 Events and Probabilities ..................................................................................29
2.2 Algebra of Events ............................................................................................29
2.3 Combinations ................................................................................................... 31
2.4 Probability Trees .............................................................................................32
2.5 Conditional Probability ................................................................................... 33
2.6 Testing Water Quality: False Negative and False Positive ..............................34
2.7 Bayes’ Theorem ...............................................................................................35
2.8 Generalization of Bayes’ Rule to Many Events ...............................................36
2.9 Bio-Sensing .....................................................................................................36
2.10 Decision Making .............................................................................................37
2.11 Exercises ..........................................................................................................39
2.12 Computer Session: Introduction to Rcmdr, Programming,
andMultiplePlots ............................................................................................40
2.12.1 R Commander....................................................................................40
2.12.2 Package Installation and Loading .....................................................40
2.12.3 R GUI SDI Option: Best for R Commander ...................................... 43
2.12.4 How to Import a Text Data File Using Rcmdr .................................. 43
2.12.5 Simple Graphs on a Text Window ..................................................... 45
2.12.6 Simple Graphs on a Graphics Window: Histograms .........................46
2.12.7 More than One Variable: Reading Files and Plot Variables ..............47
2.12.7.1 Using the R Console ...........................................................48
2.12.7.2 Using the R Commander .................................................... 51
2.12.8 Programming Loops .......................................................................... 53
2.12.9 Application: Bayes’ Theorem ............................................................ 54
2.12.10 Application: Decision Making ..........................................................55
2.12.11 More on Graphics Windows ..............................................................55
2.12.12 Editing Data in Objects .....................................................................56
2.12.13 Clean Up and Exit .............................................................................56
2.12.14 Additional GUIs to Use R .................................................................57
2.12.15 Modifying the R Commander ........................................................... 57
2.12.16 Other Packages to Be Used in the Book ............................................57
2.12.17 Computer Exercises ...........................................................................58
Supplementary Reading .............................................................................................58
Chapter 3 Random Variables, Distributions, Moments, and Statistics ....................................... 59
3.1 Random Variables ...........................................................................................59
3.2 Distributions ....................................................................................................59