DOC PREVIEW
Berkeley STAT 135 - Getting Started in R

This preview shows page 1-2-3-18-19-37-38-39 out of 39 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Getting Started in RS.A. BashirFebruary 26, 2003Copyrightc! 2003 S. A. BashirPermission is granted to make and distribute copies of this manual provided the copy-right notice and this permission are preserved on all copies.Permission is granted to copy and distribute modified versions of this manual underthe conditions for verbatim copying, provided that the entire resulting derived workis distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into anotherlanguage, under the above conditions for modified versions, except that this permissionnotice may be stated in a translation approved by S. A. Bashir.CONTENTS iContents1 Introduction 21.1 What is R? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 R and Splus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Starting and quitting R . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 On-line Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4.1 Help Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4.2 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.5 General comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.5.1 Case Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.5.2 R Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.5.3 Recalling previous commands . . . . . . . . . . . . . . . . . . . 52 Maths in R 52.1 Simple arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.1.1 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Storing values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 Logical Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.4 Managing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Vectors 83.1 Creating Simple Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.3 Generating Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.3.1 Regular Sequences . . . . . . . . . . . . . . . . . . . . . . . . . 93.3.2 Random Sequences . . . . . . . . . . . . . . . . . . . . . . . . . 103.3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.4 Vector Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.5 Extracting Elements of a Vector . . . . . . . . . . . . . . . . . . . . . 133.6 Negative Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.7 Logical Subscripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.8 More Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.9 Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17CONTENTS ii3.10 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Matrices 184.1 Matrix assignments and construction . . . . . . . . . . . . . . . . . . . 194.2 Matrix Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Data frames 235.1 Reading data from files . . . . . . . . . . . . . . . . . . . . . . . . . . 235.2 Some notes on data frames . . . . . . . . . . . . . . . . . . . . . . . . 245.3 Writing data to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.4 Factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . …


View Full Document

Berkeley STAT 135 - Getting Started in R

Download Getting Started in R
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Getting Started in R and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Getting Started in R 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?