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 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":
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?
@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: