Skip to contents

Returns the key(s) from a hash

Usage

keys(x)

  # S3 method for class 'hash'
names(x)

Arguments

x

A hash object.

Details

Returns the character vector containing the keys of a hash object.

Value

keys

A vector of type character

Author

Christopher Brown

See also

See Also hash.

Examples


  h <- hash( letters, 1:26 )
  keys(h)  # letters
#>  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
#> [20] "t" "u" "v" "w" "x" "y" "z"

  names(h) # same
#>  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s"
#> [20] "t" "u" "v" "w" "x" "y" "z"