{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

RTutorial

# RTutorial - Brief R Tutorial June 6 2008 The best way to go...

This preview shows pages 1–3. Sign up to view the full content.

Brief R Tutorial June 6, 2008 The best way to go through this tutorial is to first install a version of R (see installation section below) and type the commands along with the examples given. This way you can see for yourself what output each command gives. Contents 1 Introduction 2 2 R Basics - Installation, Starting, Quitting, and Objects 2 3 Entering or Reading Data Into R 2 3.1 Typing Data In Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.2 Reading Data From a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.3 Accessing Elements of Data Arrays, Vectors, or Matrices . . . . . . . . . . . . . . . . . . . . . 4 3.4 Determining Sizes of Data Structures/Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 Basic R Commands You Should Know 4 5 Statistical Commands You Should Know 4 6 Writing Your Own Functions and Sourcing Code 5 6.1 Writing a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6.2 For and While Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6.3 Logical Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6.4 Sourcing Code and Setting the Working Directory . . . . . . . . . . . . . . . . . . . . . . . . 6 7 Graphics 7 7.1 Creating a pdf or ps File of an R Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 8 Writing Output To A File 7 9 Installing Packages 8 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document