Setup

Send debugging-example-unfixed.R to students so they can follow along.

Basic Strategy

Observe

Run

Run line by line

print(head(df)), fix by passing data_size_class
Run
Something seems weird about these results

Debugger

Break points

  1. Insert breakpoint
  2. Source the code
  3. Program runs until breakpoint and stops (before executing the line of code)
  4. Environment gives the current values for all variables (Local vs. Global). Can switch scopes with dropdown.

Stepping

Bugs