Learn R Programming

hash (version 2.1.0.1)

is.empty: Test if a hash has no key-value pairs.

Description

is.empty tests to see if any key value pairs are assigned on a hash object.

Usage

is.empty(x)

Arguments

Value

logical.

Details

Returns TRUE if no key-value pairs are defined for the hash, FALSE otherwise.

See Also

exists.

Examples

Run this code
h <- hash( a=1, b=2, c=3 )
    is.empty(h)    # FALSE
    clear(h)
    is.empty(h)    # TRUE
    h <- hash()
    is.empty(h)    # TRUE

Run the code above in your browser using DataLab