query: Query keys from an hash table.

Description Usage Arguments Value Author(s) Examples

View source: R/generics.R

Description

These generics are used for querying a single key from an hashset or hashmap, respectively. For vectorized queries, see the subsetting_hashtables documentation page.

Usage

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

## S3 method for class 'r2r_hashmap'
query(x, key)

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

Arguments

x

an hashset or hashmap.

key

an arbitrary R object. Key to be queried from the hash table.

Value

TRUE or FALSE, for hashsets. For hashmaps, if the queried key exists in the hash table, returns the associated value (an a priori arbitrary R object); otherwise, behaves as specified by on_missing_key(x) (see also hashtable).

Author(s)

Valerio Gherardi

Examples

1
2
s <- hashset(1, 2, 3)
query(s, 3)

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