hash-class {hash}R Documentation

Class "hash"

Description

Implements a S4 hash class in R similar to hashes / associatesd arrays / dictionaries in languages. As much as possible these constructs have been given an R type interface.

Hash construction is flexible and takes several syntaxes.

Accessors are defined for \$, [ and [[.

Slots

.xData:
Object of class "environment". This is the hashed environment used for key-value storage.

Extends

None by design.

Methods

[<-
signature(x = "hash", i = "ANY", j = "missing"): ...
[
signature(x = "hash", i = "ANY", j = "missing", drop = "missing") : ...
[[<-
signature(x = "hash", i = "ANY", j = "missing"): ...
[[
signature(x = "hash", i = "ANY", j = "missing"): ...
$<-
signature(x = "hash"): ...
$
signature(x = "hash"): ...
clear
signature(x = "hash"): ...
del
signature(x = "ANY", hash = "hash"): ...
has.key
signature(key = "ANY", hash = "hash"): ...
keys
signature(hash = "hash"): ...
length
signature(x = "hash"): ...
values
signature(x = "hash"): ...
format
signature(x = "hash"): ...

Note

For lists of any appreciable length hashes provide much quicker element access than named vectors.

Objects of class hash do not release memory with a call to rm. clear must be called before rm to properly release the memory.

Author(s)

Christopher Brown

References

http://en.wikipedia.org/wiki/Hash_table

http://en.wikipedia.org/wiki/Associative_array

See Also

See also as environment.

Examples

  showClass("hash")

[Package hash version 1.0.2 Index]