Learn R Programming

datastructures (version 0.2.9)

bimap: Create a new bimap

Description

Instantiates a new '>bimap object, i.e. an unordered collection of key-value pairs with mappings $$f: keys -> values,$$ and $$f: values -> keys.$$

Usage

bimap(key.class = c("character", "numeric", "integer"),
  value.class = c("character", "numeric", "integer"))

Arguments

key.class

the primitive class type of the keys

value.class

the primitive class type of the values

Value

returns a new bimap object

Examples

Run this code
# NOT RUN {
 # create a bimap with character <-> character bi-mapping
 b <- bimap()

 # create a bimap with character <-> integer bi-mapping
 b <- bimap("character", "integer")

 # create a bimap with integer <-> integer bi-mapping
 b <- bimap("integer", "numeric")

# }

Run the code above in your browser using DataLab