Skip to content
Back to formatted view

Raw Message

Message-ID: <17037.46256.97686.143352@stat.math.ethz.ch>
Date: 2005-05-20T09:58:08Z
From: Martin Maechler
Subject: R annoyances
In-Reply-To: <Pine.A41.4.61b.0505190933480.327288@homer12.u.washington.edu>

>>>>> "TL" == Thomas Lumley <tlumley at u.washington.edu>
>>>>>     on Thu, 19 May 2005 09:39:13 -0700 (PDT) writes:

    TL> On Thu, 19 May 2005, Rod Montgomery wrote:
    >> Thomas Lumley wrote:
    >>> This one is actually a FAQ, mtx[,1,drop=FALSE]
    >>> 
    >>> -thomas
    >>> 
    >> I wonder whether there is, or should be, a way to set
    >> FALSE as the default?

    TL> There shouldn't be (apart from editing the code),
    TL> because you really don't want something this basic to be
    TL> unpredictable.

    TL> There have been discussions at several times about
    TL> whether drop=FALSE or drop=TRUE should be the
    TL> default. The decision has always been that programmers
    TL> can cope either way, but that users probably don't
    TL> expect mtx[,1] to be a vector, and that they definitely
    TL> don't expect mtx[1,1] to be a matrix.

Yes, and (as Uwe has already mentioned),
the S language has now been ``defined'' in a few ways for 
many years, and the decision to make "drop=TRUE" the default
(for arrays at least) may have been sub-optimal --- and maybe
could have been changed 15 years ago,  but not anymore nowadays:
It is implicitly made use of in too many places of existing S code.

Those of you who are new to R:  
Please don't assume R is new just because you are new to it!

Martin