has_key: Key existence in hash tables

Description Usage Arguments Value Author(s) Examples

View source: R/generics.R

Description

This generics are used to check whether a key exists in a given hashset or hashmap.

Usage

1
2
3
4
5
6
7
8
9
has_key(x, key)

x %has_key% key

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

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

Arguments

x

an hashset or hashmap.

key

an arbitrary R object. Key to be checked for existence in the hash table.

Value

TRUE or FALSE.

Author(s)

Valerio Gherardi

Examples

1
2
3
m <- hashmap(list("a", 1), list("b", 2))
has_key(m, "a")
m %has_key% "b"

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