Skip to content
Prev 17912 / 63424 Next

Subscripting issues unrelated to [Subscripting fails if name of element is "" (PR#8161)]

Jens,

This is a completely separate issue.  In indexing, character NA matches 
the name "NA".  That was a bug, but it is nothing to do with the subject 
line or PR#8161, and for the record let's keep this separate.  The 
`critical point' is not to build a theory around misunderstandings of 
several unrelated examples.

You say
goes wrong.  Now the documentation has x$name for 'name' a symbol or a 
character string, and you have passed an _expression_ and got an 
appropriate error message,

Error in get("$")(lx, as.character(NA)) : invalid subscript type

If you don't see that, please review the section in R-lang or the Blue 
Book.  Equally
Error in get("$")(lx, as.character("a")) : invalid subscript type

so it nothing to do with NA or "" or the subject line here.

On the other hand
is lx$NA, using a name (and no longer a character NA).

Brian
On Fri, 7 Oct 2005, "Jens Oehlschl?gel" wrote: