hash-accessors {hash} | R Documentation |
R style accesors for the hash-class
.
These are the hash accessor methods. They closely follow an R style.
$ 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.
Christopher Brown
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")