Re: [Rd] Strange behaviour of the [[ operator

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Sat 30 Sep 2006 - 14:39:04 GMT

>>>>> "Herve" == Herve Pages <hpages@fhcrc.org> >>>>> on Fri, 29 Sep 2006 18:06:41 -0700 writes:

    Herve> Hi,
    Herve> This looks like a bug:
hmm, maybe...
or maybe not; I vaguely recall that this is documented somewhere...

>> a <- list(b=5)
>> a[['b']]
    Herve> [1] 5
>> a[[t<-'b']]

    Herve> Nothing gets printed!

Yes, but that is not really much related to "[[" but rather to "<-" which momentarily turns off auto-printing.

Similar things happen in many similar circumstances.

    Herve> I need to use parenthesis to see the expected result:

>> a[[(t<-'b')]]

    Herve> [1] 5

    Herve> Cheers,
    Herve> H.

Martin



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun Oct 01 01:07:00 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 30 Sep 2006 - 19:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.