R/methods_keys.R
, R/ds_map_bimap.R
, R/ds_map_unordered.R
keys-methods.Rd
Extracts the keys from a map
object.
keys(obj) # S4 method for bimap keys(obj) # S4 method for unordered_map keys(obj)
obj | object to extract keys from |
---|
returns the extracted keys as vector
# returns the keys of a hashmap h_map <- hashmap("numeric") h_map[rnorm(3)] <- list(1, 2, 3) keys(h_map)#> [1] 0.1943924 1.4505432 0.4212304# returns the keys of a multimap m_map <- multimap("numeric") m_map[c(1, 2, 1)] <- list(rnorm(1), rgamma(1, 1), rexp(1)) keys(m_map)#> [1] 2 1 1