Hash/associative array/dictionary data structure for the R language.
This S4 class is designed to provide a hash-like data structure in a native R style and provides the necessary methods for all general methods for hash operations.
|License:||GPL (>= 2)|
|Depends:||R (>= 2.12.0), utils, methods|
R is slowly moving toward a native implementation of hashes
using enviroments, (cf.
Extract. Access to
environments using $ and [[ has been available for some time and
recently objects can inherit from environments, etc. But many features
that make hashes/dictionaries great are still lacking, such
as the slice operation, [.
The hash package is the only full featured hash implementation for the R language. It provides more features and finer control of the hash behavior than the native feature set and has similar and sometimes better performance.
HASH KEYS must be a valid character value and may not be the empty
HASH VALUES can be any R value, vector or object.
PASS-BY REFERENCE. Environments and hashes are special objects in R because only one copy exists globally. When provide as an argument to a function, no local copy is made and any changes to the hash in the functions are reflected globally.
PERFORMANCE. Hashes are based on R's native environments and are designed to be exceedingly fast using the environments internal hash table. For small data structures, a list will out-perform a hash in nearly every case. For larger data structure, i.e. > 500 key value pair the performance of the hash becomes faster. Much beyond that the performance of the hash far outperforms native lists.
MEMORY. Objects of class
hash do not release memory with a call to
clear must be called before
rm to properly
release the memory.
Maintainer: Christopher Brown <chris.brown -at- decisionpatterns -dot- com>
1 2 3 4 5 6 7 8 9 10 11
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.