[R] obtaining the name of a named list

About this list Date view Thread view Subject view Author view Attachment view

From: Ned (gned@optusnet.com.au)
Date: Sun 16 May 2004 - 23:34:40 EST


Message-id: <4.2.2.20040516233100.00b1ba50@pop-server>

I have a list d, in which the names of each elements are single characters,
and the actual elements are bit sequences representing those characters. If
I type d[1], I get the name and the bit sequence. If I type d[[1]], I get
only the bit sequence.

What I want is some way to be able to get the name of the element,
preferably by specifying an index into the array.

e.g.

> d
       A B C
"00000" "00001" "0001"

I want some way of saying "give me the name for element number 2" and it
should return B.

cheers,

Ned

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:11 EST