Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make q('yes') the default quitting behavior in R using .Rprofile?

Tags:

r

I'd like to be able to type q() in R and have R quit rather than be prompted as to whether I want to quit.

Is there some code that I could put into my .Rprofile file to make this happen?

I'd prefer if I didn't have to have a custom function floating around in my workspace.

like image 267
Jeromy Anglim Avatar asked Oct 24 '12 04:10

Jeromy Anglim


1 Answers

In your Rprofile.site file:

q <- function(save = "yes", status = 0, runLast = TRUE){
.Internal(quit(save, status, runLast))
#<environment: namespace:base>
}
like image 158
Brandon Bertelsen Avatar answered Nov 15 '22 10:11

Brandon Bertelsen