# Keys and values can be arbitrary R objectsm[[ lm(mpg ~ wt, mtcars) ]] <-c(TRUE, FALSE, TRUE)m[[ lm(mpg ~ wt, mtcars) ]]
[1] TRUE FALSE TRUE
Getting help
For further details, including an introductory vignette illustrating the features of r2r hash maps, you can consult the r2rwebsite. If you encounter a bug, want to suggest a feature or need further help, you can open a GitHub issue.
Comparison with hash
CRAN package {hash} also offers an implementation of hash tables based on R environments. The two tables below offer a comparison between {r2r} and {hash} (for more details, see the benchmarks Vignette)
Features supported by {r2r} and {hash}.
Feature
r2r
hash
Basic data structure
R environment
R environment
Arbitrary type keys
X
Arbitrary type values
X
X
Arbitrary hash function
X
Arbitrary key comparison function
X
Throw or return default on missing keys
X
Hash table inversion
X
Performances of {r2r} and {hash} for basic hash table operations.