keys-methods: Get keys from an object

Description Usage Arguments Value Examples

Description

Extracts the keys from a map object.

Usage

1
2
3
4
5
6
7
keys(obj)

## S4 method for signature 'bimap'
keys(obj)

## S4 method for signature 'unordered_map'
keys(obj)

Arguments

obj

object to extract keys from

Value

returns the extracted keys as vector

Examples

1
2
3
4
5
6
7
8
9
 # returns the keys of a hashmap
 h_map <- hashmap("numeric")
 h_map[rnorm(3)] <- list(1, 2, 3)
 keys(h_map)

 # 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)

datastructures documentation built on Aug. 10, 2020, 5:08 p.m.