has.key {hash}R Documentation

Test for existence of key(s) on a hash

Description

has.key returns a logical vector as long as keys, indicating which keys are defined on the hash.

Usage

has.key(key, hash, ...)

Arguments

key A vector whose entries will be coerced to valid keys.
hash A hash object.
... arguments passed to further functions

Value

logical A logical vector of length key indicating whether the key is defined in the hash. has.key also accepts ... to be passed to underlying sapply

Author(s)

Christopher Brown

See Also

See also hash

Examples

                            

    h <- hash( letters, 1:26 )
    all( has.key( letters, h ) ) # TRUE

[Package hash version 0.23 Index]