Chapter 21 Troubleshooting basic problems

Forgetting the second closing parenthesis is a major cause of mistakes when learning R. If something doesn’t work, press the escape key in the upper left-hand corner of your keyboards (labeled “esc” or “ESC”) a couple of times, then first check to make sure you have the sneaky second ).

This is important so I’ll repeat it:

Forgetting the second parenthesis is a major cause of mistakes when learning R. If something doesn’t work, press the escape key a couple of times, then first check to make sure you have both parantheses.

21.1 Bad arguments

None of these work

plot(lynx, log  = y)
plot(lynx, log  = "y)
plot(lynx, log  y)

21.2 Hung code

When we forget a closing parenthesis in R we get hung code. We think we told R to do something, like make a plot, but nothing happens.

21.3 Missing quotes