[R] Quiz {was "Quit asking me .."}

Martin Maechler maechler at stat.math.ethz.ch
Wed Sep 17 08:36:19 CEST 2003


>>>>> "Spencer" == Spencer Graves <spencer.graves at pdf.com>
>>>>>     on Tue, 16 Sep 2003 19:54:22 -0700 writes:

    Spencer> Consider
    Spencer>  Q <- function(x)q("no")

    Spencer> With R 1.7.1 under Windows, "Q()" caused R to close
    Spencer> without asking for confirmation.  This does not
    Spencer> solve the whole problem, but it might provide a
    Spencer> piece of the puzzle.

Apropos, this reminds me of the old quiz (from the S-plus times):

How can you write (quite short!) R code such that
typing
	"Q"   

-- without any  "()" -- will quit R (without asking about saving).

[But you shouldn't really keep that code active in your standard R session
 because it would be too easy to accidentally shut down R !]

For the advanced ones: 
My shortest solution uses 51 characters of R code, can you beat that?

-- 
Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><




More information about the R-help mailing list