Description Usage Arguments Value Examples
Erase a vector of key-value pair from a map
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | erase(obj, key, value)
## S4 method for signature 'map,vector,missing'
erase(obj, key)
## S4 method for signature 'bimap,missing,vector'
erase(obj, value)
## S4 method for signature 'multimap,vector,vector'
erase(obj, key, value)
## S4 method for signature 'multimap,vector,list'
erase(obj, key, value)
## S4 method for signature 'multimap,vector,ANY'
erase(obj, key, value)
|
obj |
the object to pop an element from |
key |
a vector of keys that should be removed |
value |
optionally a list of values needs to be supplied for some data
structures such as |
returns obj
with removed values
1 2 3 4 5 6 7 8 9 10 11 | # erases keys from a hashmap or bimap
h_map <- hashmap()
h_map[letters] <- rnorm(length(letters))
h_map <- erase(h_map, "a")
h_map <- erase(h_map, letters[2:5])
# erases keys from a multimap
m_map <- multimap()
m_map[c("a", "a", "a", "b", "b", "c")] <- rep(1:2, 3)
m_map <- erase(m_map, "a")
m_map <- erase(m_map, "b", 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.