hash_set: Hash set implemented by std::unordered_set

View source: R/hash_set.R

hash_setR Documentation

Hash set implemented by std::unordered_set

Description

Hash set implemented by std::unordered_set

Usage

hash_set(keys)

## S4 method for signature 'hash_unordered_set'
hash_exists(h, keys)

## S4 method for signature 'hash_unordered_set'
hash_insert(h, keys)

## S4 method for signature 'hash_unordered_set'
hash_delete(h, keys)

## S4 method for signature 'hash_unordered_set'
hash_size(h)

## S4 method for signature 'hash_unordered_set'
hash_copy(h)

## S4 method for signature 'hash_unordered_set'
hash_keys(h)

## S4 method for signature 'hash_unordered_set'
hash_values(h, keys = NULL)

## S3 method for class 'hash_unordered_set'
x[[i]]

## S3 method for class 'hash_unordered_set'
x[i]

## S3 method for class 'hash_unordered_set'
x$name

## S3 replacement method for class 'hash_unordered_set'
x[[i]] <- value

## S3 replacement method for class 'hash_unordered_set'
x[i] <- value

## S3 replacement method for class 'hash_unordered_set'
x$name <- value

## S3 method for class 'hash_unordered_set'
length(x)

## S4 method for signature 'hash_unordered_set'
show(object)

as.hash_set(x)

## Default S3 method:
as.hash_set(x)

## S3 method for class 'hash_unordered_set'
as.vector(x, mode = "any")

Arguments

keys

A character vector. Keys should have no duplicates.

h, x, object

A hash_unordered_set object returned by hash_set().

i, name, value

Keys and values.

mode

Please ignore.

Details

Hash set has no values associated.

$, [[ and [ return logical vectors. ⁠$<-⁠, ⁠[[<-⁠ and ⁠[<-⁠ insert or delete keys.

Value

hash_set(), hash_insert(), hash_delete(), hash_copy() returns a hash_unordered_set object. hash_exists() returns a logical vector. hash_size() returns an integer. hash_keys() returns a character vector. hash_values() throws an error.

Examples

h = hash_set(letters)
hash_exists(h, c("a", "b", "foo"))
hash_insert(h, "foo")
hash_delete(h, "foo")
h$a
h$foo

as.hash_set(letters)

hashtable documentation built on July 27, 2026, 5:09 p.m.