0

When I try to clear the workspace in R console, it always pops up a dialog saying:

All objects in the workspace will be removed. Are you sure you want to proceed?

enter image description here

Can I have a way to disable this popup?

user321627
  • 2,350
  • 4
  • 20
  • 43
  • Is this R or is this RStudio? What method do you use to clear workspace? Which OS are you using? – jay.sf Jun 01 '20 at 05:28

1 Answers1

1

There are some suggestions (here) depending on your platform. Looks like passing the "no-save" option when invoking R is your best bet: https://stackoverflow.com/a/4996252/8273813

Nate
  • 36
  • 2
  • The above occurs not when I am exiting, but any time I am trying to clear the workspace. I am able to invoke the no-save option but still have the above issue. – user321627 Jun 01 '20 at 04:16
  • As a workaround until you find a proper solution for Console, you could add a function to .Rprofile. This might actually be an advantage since you can exclude objects. Here's an example adapted from [this thread](https://stackoverflow.com/questions/46966847/rmlist-ls-doesnt-work-inside-a-function-why). `clr <- function() { rm(list = ls(envir = .GlobalEnv)[-which(ls(envir = .GlobalEnv) %in% c("clr"))], envir = .GlobalEnv)` } – Nate Jun 01 '20 at 06:38