insert: Insert keys or key/value pairs into an hash table.

Description Usage Arguments Value Author(s) Examples

View source: R/generics.R

Description

These generics are used for inserting a single key or key/value pair into an hashset or hashmap, respectively. For vectorized insertions, see the subsetting_hashtables documentation page.

Usage

1
2
3
4
5
6
7
insert(x, key, ...)

## S3 method for class 'r2r_hashmap'
insert(x, key, value, ...)

## S3 method for class 'r2r_hashset'
insert(x, key, ...)

Arguments

x

an hashset or hashmap.

key

an arbitrary R object. Key to be inserted into the hash table.

...

further arguments passed to or from other methods.

value

an arbitrary R object. Value associated to key.

Value

key for the hashset method, value for the hashmap method.

Author(s)

Valerio Gherardi

Examples

1
2
3
s <- hashset()
insert(s, "foo")
s[["foo"]]

r2r documentation built on July 6, 2021, 5:12 p.m.