Skip to contents

Removes key-value pair(s) from a hash.

Usage

del(x,hash)
  delete(x,hash)

Arguments

x

An object that will be coerced to valid key(s) to be removed from the hash. x will be coerced to a valid hash keys using make.keys

hash

A hash object

Value

None. This method exists solely for the side-effects of removing items from the hash.

Author

Christopher Brown

See also

See Also as hash, make.keys.

Examples


  h <- hash( letters, 1:26 )
  h # 26 elements
#> <hash> containing 26 key-value pair(s).
#>   a : 1
#>   b : 2
#>   c : 3
#>   d : 4
#>   e : 5
#>   f : 6
#>   g : 7
#>   h : 8
#>   i : 9
#>   j : 10
#>   k : 11
#>   l : 12
#>   m : 13
#>   n : 14
#>   o : 15
#>   p : 16
#>   q : 17
#>   r : 18
#>   s : 19
#>   t : 20
#>   u : 21
#>   v : 22
#>   w : 23
#>   x : 24
#>   y : 25
#>   z : 26
  del( "a", h )
  h # 25 elements
#> <hash> containing 25 key-value pair(s).
#>   b : 2
#>   c : 3
#>   d : 4
#>   e : 5
#>   f : 6
#>   g : 7
#>   h : 8
#>   i : 9
#>   j : 10
#>   k : 11
#>   l : 12
#>   m : 13
#>   n : 14
#>   o : 15
#>   p : 16
#>   q : 17
#>   r : 18
#>   s : 19
#>   t : 20
#>   u : 21
#>   v : 22
#>   w : 23
#>   x : 24
#>   y : 25
#>   z : 26