[R] hash or other quick lookup function?

From: Esmail Bonakdarian <esmail.js_at_gmail.com>
Date: Tue, 27 May 2008 10:46:59 +0200

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.


R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 27 May 2008 - 08:59:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 27 May 2008 - 13:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive