h <- hash( letters, 1:26 )
# USING del
del( "a", h ) # delete key a
del( c("b","c"), h ) # delete keys b, c
# USING rm
rm( "d", envir=h ) # delete key d
rm( list= c("e","f"), envir=h ) # delete keys e,f
# USING R syntsx
h$g <- NULL # delete key g
h[['h']] <- NULL # delete key h
h['i'] <- NULL # delete key i
h[ c('j','k')] <- NULL # delete keys e,f
keys(h)
D
Run the code above in your browser using DataLab