Options error in Rmd code chunks

Hi all,

I have a strange issue into which hopefully someone can offer some insight.

I have just updated R to version 3.6, and am encountering an issue that occurs only in markdown code chunks.

Any code I run from a code chunk results in the message Error: option error has NULL value being repeatedly printed in the console. Entering options('error') after restarting returns:


Strangely, inline code seems to run fine, eg r plot(cars) prints the plot in the plot windows, but the same code run from with the code chunk causes the problem. The error also only seems to occur when run in interactive sessions. The only way to stop the behaviour is to terminate RStudio via the Windows Task Manager.

Setting options(error = recover) works to resolve the issue, until restarting RStudio (or inserting it into my .Rprofile Nope, doesn't work). However, as far as I can tell from ?options and some Googling, NULL is the default setting, so any idea why this is happening? And why only in rmarkdown code chunks?

Any info on this would be great,


I only see this in the notebook mode. In regular rmarkdown, the chunk renders correctly.

This Github issue sounds related. A possible fix via an updated version of RStudio is referenced there; you might see if that fixes the issue for you, as well.

1 Like

Ah, nice! I didn't manage to dig up anything useful, but that did the trick.

Many thanks aosmith

This topic was automatically closed 7 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.