R Fundamentals - Part I

To register, select the appropriate workshop here.


This 3-part workshop series led by DSI Director and Professor of Statistics Duncan Temple Lang explores the underlying computational model of the R language. It is strongly encouraged, although not required, that you attend all three sessions as they build upon each other. A longer version of this series was taught in the DSI as a mini-course in summer 2017.

The aim of this series is to help participants understand the relatively small but fundamental computational model underlying the R language. This will help you reason about code before you write and run it, and to debug it if it doesn't do what you want. A sound understanding of this computational model makes programming in R much easier and more productive. Basically, we want you to understand how the R interpreter works.


This is not an introduction to R. Participants are expected to have an elementary understanding and prior experience using R, be comfortable with basic R syntax, and to have it pre-installed and running on their laptops. This series is appropriate for motivated beginners as well as intermediate to advanced users who want a better understanding of base R. It is open to UC Davis faculty, graduate students, postdocs, staff, and undergraduates; DSI affiliates receive priority registration.



  • Goal of this workshop series is to learn the grammar of the R language (not just the vocabulary!):
    • how R actually works
    • be able to reason about R code
    • what R does and how to do things
    • increase productivity and confidence in using R
  • Content:

    • Part 1:

      • REPL: Read, Evaluate, Print, Loop
        • Read includes parsing (R assesses whether the command is grammatically correct)
        • It can be helpful to know whether an error is in the parse or eval step
      • Parsing: grammatical construction
        • If you get an error, use the parse() functionality to check
        • class() tells you what an object is
      • Evaluation, Function calls
        • everything in R is a function call
        • how do you ask if something is a function? Example: get("+") will tell you that + is a primitive
    • Part 2: Data types, subsetting

    • Part 3: Functions, debugging formula, S3 & S4