R-alpha: Re: R-0.15: problem with dimnames<-() --- x[[i]] <- NULL

Kurt Hornik (Kurt.Hornik@ci.tuwien.ac.at)
Wed, 8 Jan 1997 08:26:41 +0100


Date: Wed, 8 Jan 1997 08:26:41 +0100
Message-Id: <199701080726.IAA07363@aragorn.ci.tuwien.ac.at>
From: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>
To: Martin Maechler <maechler@stat.math.ethz.ch>
Subject: R-alpha: Re: R-0.15: problem with dimnames<-() ---   x[[i]] <- NULL
In-Reply-To: <9701070904.AA01283@>
 <9701070904.AA01283@>

>>>>> On Tue, 7 Jan 97 10:04:59 +0100,
>>>>> Martin Maechler <maechler@stat.math.ethz.ch> said:

>>>>> "Ross" == Ross Ihaka <ihaka@stat.auckland.ac.nz> writes:
Ross> Kurt Hornik writes:
>>> The following problem exists:
>>> 
R> x <- matrix(1:4, 2, 2) x
>>> ........
Ross> ......... much omitted .....

Ross> This is why I'm not totally happy about the use of x[[i]] <- NULL
Ross> to remove the i-th component of x.  It makes more sense to me to
Ross> have x[[i]] make the i-th component be NULL and to have
Ross> x[i]<-NULL remove the ith component.  This is in the spirit of
Ross> "[[" manipulating things in a list while "[" manipulates the list
Ross> itself.  In S it appears that "[<-" is a no-op for lists.

> Already last time you mentioned this,
> I said to myself "this would be a place, where  R should improve on S
> 		  with the price of being incompatible"..
> Does anybody know of  any S packages / functions
> which make use of this "misfeature"?

> If there are only very few,  I think you should adopt your proposal
> which really makes much more sense!
> [[and add a note in $RHOME/README  which lists differences  R <-> S]].

I agree.  Makes MUCH MORE SENSE!  (And let's not start singing Talking
Heads songs here ...)

> Well, then, after some time, people will start sending bug reports to
> StatSci/Mathsoft, complaining about the unreasonable behavior of Splus
> which is even incompatible with R  ;-)

Would be wonderful ... :-)

-k


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-