Re: [Rd] names generated in list indexing

2008-11-29 Thread Gabor Grothendieck
Also note the behavior is the same for a non-list vector: > c(b=1)[c('a','b')] b NA1 but differs for a data frame: > data.frame(b=1)[c('a','b')] Error in `[.data.frame`(data.frame(b = 1), c("a", "b")) : undefined columns selected On Fri, Nov 28, 2008 at 2:03 PM, Vadim Ogranovich <[

[Rd] names generated in list indexing

2008-11-28 Thread Vadim Ogranovich
Dear R-devel, When a character vector is used to subscript a list and when some of the subscripts are not present in the list names R returns NULL for those subscripts and generate NA names for each of them: > list(b=1)[c('a','b')] $ <<-- generated name NULL $b [1] 1 Wouldn't it be more int