Skip to content
Prev 12335 / 63461 Next

More user-friendly error message needed.

"Warnes, Gregory R" <gregory_r_warnes@groton.pfizer.com> writes:
Because of partial matching, list$name can return a result when 
your has.element function returns FALSE.
[1] 1 2 3
[1] FALSE

Before we go too far in speculating about what the $ operator should
or should not return when the name is not matched, let's all remember
that the semantics of the $ operator explicitly state that it should
return NULL and, as Duncan wrote, there are many, many places in the
base code for R that depend upon this behavior.  Trust me - you really
don't want to change this.