hash-accessors {hash}R Documentation

Accessor methods for the hash class.

Description

R style accesors for the hash-class.

Details

These are the hash accessor methods. They closely follow an R style.

Value

$ returns the hash entry for the supplied key.
[ returns a hash slice, a sub hash with only the defined keys.
[[ returns a list of values.

Author(s)

Christopher Brown

See Also

hash, .set

Examples

    h <- hash()
    h <- hash( letters, 1:26 )

        h$a                     # 1
        h$a <- "2"   

        h[ letters[1:4] ]    # hash with a,b,c,d
        h[ letters[1:4] ] <- 4:1
        
        h[[ letters[1:4] ]] # c("a","b","c","d") 


[Package hash version 0.23 Index]