Description Usage Arguments Value Author(s) See Also Examples
Removes key-value pair(s) from a hash by name of the object. There are also
R-like methods described in Extract. To delete all keys, use
clear()
.
1 2 3 4 5 6 7 8 9 10 11 12 |
x |
An object that will be coerced to valid key(s) to be removed from
the hash. |
hash |
A |
None. This method exists solely for the side-effects of removing items from the hash.
Christopher Brown
base::rm()
base function used by del
Extract for R-like accessor
clear()
to remove all key-values and return an empty hash
hash()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.