On 27 Jan 2006, [EMAIL PROTECTED] wrote:
> But mylist$entrylabel is not working inside the loop.

'$' doesn't evaluate its argument.  You want mylist[[entrylabel]].


> I haven't been able to found my way with R lists, maybe because I'm
> comparing them with perl's hashes.

R lists do have names, but they are not hashes.  You can have
duplicate names in different positions in a list.

You can get at list elements by name using $name and [[name]], but the
argument to $ has to be the actual name, not a var containing the
name.

You can also access elements by number using [[i]]

HTH,

+ seth

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

Reply via email to