
Appendix B
R Quick Start
Here we present a quick introduction to the R data/statistical programming
language. Further learning resources are listed at http://heather.cs.
ucdavis.edu/
~
/matloff/r.html.
R syntax is similar to that of C. It is object-oriented (in the sense of encap-
sulation, polymorphism and everything being an object) and is a functional
language (i.e., almost no side effects, every action is a function call, etc.).
B.1 Correspondences
aspect C/C++ R
assignment = <- (or =)
array terminology array vector, matrix, array
subscripts start at 0 start at 1
array notation m[2][3] m[2,3]
2-D array storage row-major order column-major order
mixed con ...