[R] hash or other quick lookup function?

Esmail Bonakdarian esmail.js at gmail.com
Tue May 27 10:46:59 CEST 2008


Hello all,

I have a matrix of bit values.

I compute certain values based on the bits in each row. There may be
*duplicate* entries in the matrix, ie several rows may be identical.
These rows change over time, and identical entries may not be next to
each other.

Computing these values is time consuming, so I would like a way to store a
value once it's computed. That way I would be able to look up the value
based on a given bitstring (row in the matrix) and avoid having to re-compute
the same value.

So, my thought is a hash function based on a bit string - does R have such
a thing? Or is there an alternative approach that would do the same in R?
The lookup should be quick, otherwise the gains from avoiding
recomputing identical values would be lost to some extent.

I wasn't able to find anything via searches, I am hoping someone can
point me in the right direction.

Thanks
Esmail



More information about the R-help mailing list