# r_intro.pdf - Lab Guide u2014 An Introduction to R The aim...

• 34

This preview shows page 1 - 3 out of 34 pages.

Lab Guide — An Introduction to R The aim of this lab guide is to introduce the statistical computing language R . Initially we simply use R as a clever calculator, and later gently introduce the key components of writing your own programs. Contents 1 Getting Started with R 2 2 Using R as a Calculator 5 2.1 Scalars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Functions and Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4 Integer Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.5 Logical Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.6 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.7 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3 Practice Problems 25 A Managing Your Work Environment 33 1 An Introduction to R