Learn R Programming

hash (version 2.1.0.1)

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, ...)

Arguments

Value

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

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