h <- hash( letters, 1:26 )
values(h) # 1:26
values(h, simplify = FALSE )
values(h, USE.NAMES = FALSE )
h <- hash( 1:26, letters )
values(h)
values(h, keys=1:5 )
values(h, keys=c(1,1,1:5) )
values(h, keys=1:5) <- 6:10
values(h) <- rev( letters )
# When values are obejcts
h <- hash( c('a','b'), Sys.time() )
class(h$a) # "POSIXct" "POSIXt"
vals <- values( h )
class(vals) # Numeric
vals <- values(h, simplify=FALSE )
class(vals) # List
class( Reduce( c, vals ) ) # "POSIXct" "POSIXt"
Run the code above in your browser using DataLab