Error exiting R/RStudio using q()

For the past week I have been getting an error on exiting R/RStudio when I have done any computation and try to exit using q():

library(tidyr)
> library(tibble)
> junk <- iris %>% group_by(Species) %>% 
+   summarise(list(enframe(quantile(Petal.Width))))
> q()
Error: option error has NULL value
Error: option error has NULL value

This happens on both of my Windows 10 machines. I am using R 3.6.0 and RStudio 1.2.1335. No problems if I just open libraries. The error only occurs when I have done an actual data operation. This is not a big problem, as CTL-Q still works, but it is a bit annoying as I have been exiting using q() for years. Any ideas what is going on?

Larry Hunsicker

Addendum: This appears to be an RStudio problem, as it does not happen when I use native R.

This could be related to this issue

This seems to be a different problem.
First, I don't have an .Rprofile in the relevant Rstudio workspace. This anomaly occurs in all of my workspaces, none of which set the error option.
Second, the value of options()$error is not changed in the course of the commands listed in my original message above -- as soon as I open RStudio, after loading the libraries, and after the command creating "junk":

> options()$error
(function () 
{
    .rs.recordTraceback(TRUE, 5, .rs.enqueueError)
})()
>

Third, the anomaly seems only to occur after using a command from the dplyr package, not after any other data commands. (It occurs after using any of group_by(), arrange(), select(), filter(), or mutate().) I think that there may be a bug in the dplyr package that was activated with the above change in R with 3.0.6. Should I report this to the dplyr bug URL?

Larry Hunsicker

Does this make the problem go away?

> options("rstudio.errors.suppressed"=FALSE)

Yes! Do I have to put this into an .Rprofile or does entering it once fix the problem?

What is going on with the error?

Larry Hunsicker

@andresrcs is correct; you're seeing the bug described in the link above. You can either put that in your .Rprofile or use a preview build (we have already fixed this bug in the development builds). Here's a build with a fix:

https://s3.amazonaws.com/rstudio-ide-build/desktop/windows/RStudio-1.2.1521.exe

1 Like

Thanks! Since CTL-Q still works, I'll use that until your new build becomes final.

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.