Archived Class


R Programming: Part 1

No experience with R or programming will be assumed, although some exposure to programming concepts may be helpful.

The goal will be to tour enough features of R that attendees can later pursue topics in greater depth on their own.

  • lntroductory remarks about R: history, popularity, applications, competing languages
  • Interacting with R: REPL and scripts
  • Representing and manipulating data ("nouns" of the language)
    • constants, variables, functions, types
    • R's type system
    • atomic types (numeric, integer, character, factor, etc.)
    • complex types (vector, matrix, dataframe, list, etc.)
  • Built-in functions ("verbs" of the language)
  • Calling functions, parameters
  • Descriptive statistics (table, mean, var, etc.)
  • Regression and classical statistical tests
  • Random routines
  • Scatterplots (aside: polymorphism)
  • Histogram, barplot, boxplot
  • Graphics options (color, legend, mfrow, etc.), model formulas
  • Importing/exporting locally/remotely
  • Memory dumps
  • Basic graphics
  • Getting data into and out of R

If you would like to follow along on your own computer, please have R installed.

Download R installation instructions for Apple, PC, or Linux


  • The Quick-R: a good mix of concise tutorial pages and reference material
  • "Modern Applied Statistics with S-Plus" by Venables and Ripley:  an authoritative but introductory textbook. Gives some background on statistical methods, besides showing how to implement them in R
  • The official R mailing list, which has searchable archives covering many years of questions. If you have an R question, almost certainly someone has asked it on the list. Nowadays, mainly due to stackexchange, I would simply use Google, which ranks stackexchange sites and the R mailing list highly. An added benefit of stackexchange is that oftentimes questions about R are closely related to questions about data analysis or statistics, and these are all appropriate topics for stackexchange.

Stanford Medicine