Re: [Rd] named empty list

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Fri, 04 Jun 2010 11:43:38 +0200

>>>>> "HP" == Hervé Pagès <hpages_at_fhcrc.org> >>>>> on Thu, 03 Jun 2010 13:25:10 -0700 writes:

ink1">    HP> Hi,
    HP> I just realized that a named empty list is displayed the same
    HP> way as an empty list:

>> list(aa=2:5)[0]
    HP> list()
>> list()

    HP> list()

    HP> For empty atomic vectors, the print method makes the difference:

>> c(aa=3L)[0]
    HP> named integer(0)
>> integer(0)

    HP> integer(0)

    HP> Maybe lists could do that too?

Yes, I agree. I have had at least one situation in the past where I had even been confused for a few minutes by this. I'm about to add it for R-devel [2.12.0] (only; considering it a new feature).

Martin Maechler, ETH Zurich



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 04 Jun 2010 - 09:49:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Jun 2010 - 21:30:59 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.

list of date sections of archive