Script run in RStudio now halts on first error

Hello, I have recently found that all scripts run in RStudio are now stopping on the first error instead of throwing the message and continuing to run subsequent lines. This doesn't happen with the same scripts run in vanilla R, so I think it must be some setting in RStudio. I've checked the debugging options and error is set to "Message only". My error option is still on the NULL default a la "options(error = NULL)".

For example, if I run:

dats=rnorm(10000, 0, 1)
dats=data.frame(index=1:1000, data=dats)
ggplot()+geom_points(data=dats, aes(x=index, y=dats)) #intentional error line
plot(dats$index, dats$data)

I would like it to run the whole script, and throw an error at the ggplot command but then continue to run the next two lines, as it used to. Is there some new setting or option I'm missing?


This was an intentional change in RStudio since most of the time an error means the rest of your code will not run correctly. However, you're not alone in preferring the previous behavior! Please comment/upvote this issue:

I really like this change, most of the time, but sometimes it's a nightmare and I'm surprised there isn't an option to turn this behaviour on/off.

I've added a comment to the github link.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.