Adding context and pedagogy to error messages

Hi everyone, I'm Will, a PhD student at Stanford doing research in programming and cognitive science. I'm currently working on an "Auto TA" project to help new R users (particularly those with no prior programming experience) learn to overcome basic R errors. Here's a screenshot of a prototype my team has built where we diagnose a syntax error:

Currently, our primary learning goals for the tool are:

  1. Learn how to read error messages (e.g. locate most relevant information to understanding error)
  2. Learn how to systematically diagnose potential causes of errors
  3. Learn how to write effective search queries for Google/StackOverflow

We're starting by addressing the object not found, could not find function, unexpected *, and cannot open the connection errors.

My questions for you:

  1. Are there particular errors that you found hard to solve, especially as a novice?
  2. Are there particular concepts in R you found hard to learn, or kinds of syntax you found confusing?
  3. Do you have any other ideas for ways a tool could provide automated feedback for common R errors?

You can follow our progress on Github if you're interested: https://github.com/willcrichton/r-autota

2 Likes

Hi,

This is a great idea and very useful work! Though I'm sure it'll be a great challenge, especially if you want to make this systematic :slight_smile:

On the top of my head, here are some errors I found hard to grasp as a novice (or still don't like):

  • object of type 'closure' is not(?) subsettable, online example
  • errors based on stringsAsFactors = T when you don't know that strings automatically convert to factors
  • if you are planning to incorporate Shiny: the reactive environment not found error is the most basic but complex one to get a feel for

Concepts and syntax:

  • Differences / similarities between base-R and the Tidyverse, and why the latter is often more powerful. It took me a long time to discover the Tidyverse because I coudn't see why it would be better or faster (if only I had known :stuck_out_tongue: )
  • Subsetting complex lists is can also be a nightmare. Difference between list[[ element ]] and list[element] or accessing specific elements in sublists.

If I think of more I'll let you know!

PJ

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.