Learn R Programming

hash (version 2.2.6.3)

has.key: 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, ...)

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

Arguments

key

A vector whose entries will be coerced to valid keys.

hash

A hash object.

...

arguments passed to further functions

Author

Christopher Brown

Details

None.

See Also

See also hash

Examples

Run this code

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

Run the code above in your browser using DataLab