When I exit the interactive R shell, it displays an annoying prompt every time:
> > Save workspace image? [y/n/c]: n
I\'m always answering \"no\" to it
How about just avoiding the prompt by typing q('no')
instead
If you are using Rgui, right-click on the icon you use to start R and click on "Properties", and add --no-save to the command that starts R.
(from http://tolstoy.newcastle.edu.au/R/help/05/03/1115.html)
If you are using a different editor than Rgui, you have to pass --no-save to the R command line when starting R
You can create an alias for the R command:
using bash: alias R='R --no-save'
using csh: alias R 'R --no-save'
Overwrite default option for save argument of quit function
formals(quit)$save <- formals(q)$save <- "no"
put this line in .Rprofile
Edit: added q
, so there is no prompt no matter which variant is used
If you feel adventurous enough, you could also edit the startup
section at the end of /usr/bin/R
, i.e. add --no-save
to the exec calls. However, if you need to save your workspace, remember to save.image()
.