[R] Can one set --no-save in .Rprofile

Thomas Lumley thomas at biostat.washington.edu
Thu Jan 18 17:20:35 CET 2001

On Thu, 18 Jan 2001, Michael M. Meyer wrote:

> Thanks to Brian Ripley and Robert Gentleman
> who both suggested  adding
> rgentlem at jimmy.harvard.edu said:
> >    q<-function (save = "no", status = 0, runLast = TRUE)
> >  .Internal(quit(save, status, runLast)) 
> to the .Rprofile.
> While this works (and I might use it), it is not as clean as I would 
> like.  For instance, with this profile, if I subsequently run
> 	R --save
> the "--save" will be ignored.

You can get around this using commandArgs() to find out if --save was
specified (at least on Unix, I haven't checked on Windows)

Define qsave() and qnosave() as quit functions with the
"no" and"yes" defaults and then

if (match("--save",commandArgs(),FALSE))


Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list