Intro to R R is a free version of S-plus R is a free version of S-plus Can be used interactively but script or syntax files are commonly used to record and reproduce steps. Can be used interactively but script or syntax files are commonly used to record and reproduce steps. R consists of a set of “base” routines and a large library of user supplied “packages” R consists of a set of “base” routines and a large library of user supplied “packages”
R documentation Basic manual for R Basic manual for R Venables, W. N. and Ripley, B. D., 4th edn Modern Applied Statistics with S. Springer, NY Venables, W. N. and Ripley, B. D., 4th edn Modern Applied Statistics with S. Springer, NY Free documentation on CRAN Free documentation on CRAN CRAN user help listserve CRAN user help listserve Searchable mail archives Searchable mail archives Google Google
Getting Help > help(command) > help(command) >?(command) >?(command) > help.search("matrix") > help.search("matrix") lists all functions whose help pages have a title or alias in which the text string “matrix” appears lists all functions whose help pages have a title or alias in which the text string “matrix” appears > apropos(“matrix”) > apropos(“matrix”) lists all function names that include the text “matrix” lists all function names that include the text “matrix”
R objects R is an object-oriented programming language R is an object-oriented programming language R functions operate on objects R functions operate on objects e.g., vectors, matrices, arrays, lists, data frames e.g., vectors, matrices, arrays, lists, data frames Basic analysis are typically conducted by working with DATA FRAMES Basic analysis are typically conducted by working with DATA FRAMES Generally try to avoid looping Generally try to avoid looping
Data Entry I generally use excel, save as a “csv” format, and then read into R I generally use excel, save as a “csv” format, and then read into R R can also read in other data structures such as SPSS, SAS, SYSTAT, ect... R can also read in other data structures such as SPSS, SAS, SYSTAT, ect...
Learning R Best way is to just start using it Best way is to just start using it Keep one of the reference cards handy Keep one of the reference cards handy Keep a file where you store examples of handy code/tricks so you can find them later Keep a file where you store examples of handy code/tricks so you can find them later
Let's start with a simple example