Skip to content
Prev 180889 / 398525 Next

exists function on list objects gives always a FALSE

Stavros Macrakis wrote:
kills indeed:

    foo = list(bar=1)

    with(foo, bar)
    # 1

    foo$bar = NULL
    with(foo, bar)
    # error: object 'bar' not found
but:

    # cleanup -- don't do it in mission critical session
    rm(list=ls())

    foo
    # error: object 'foo' not found

    foo = NULL
    foo
    # NULL

that is, foo$bar = NULL kills bar within foo (even though NULL is a
valid component of lists), but foo = NULL does *not* kill foo.
... and its zemanticks.

vQ