[R] Is it a bug in list() behavior?

wolski wolski at molgen.mpg.de
Mon Mar 24 16:48:28 CET 2003


Hello!

let:

test<-1:3
list(test)
names(test)<-c("X11","X12","Y23")
>test[["Y2"]]
3

I had assumed that the names in a list are like a keys in a hash.
Therefore i thought that no value should be returned.

The behavior of:

>test["Y2"]
<NA> 
  NA 

is as i expected.


Should it be as it is? How is the definition of [[]] and []?

/Eryk



More information about the R-help mailing list