[Rcpp-devel] hash

Aileen Lin aileenshanhong.lin at gmail.com
Wed Mar 20 05:03:27 CET 2013


Can anyone give me an example of how to use hash table to do joins? For
example,

a <- matrix(c(1:14), ncol = 2, dimnames = list(NULL, c('id','value')))
b <- matrix(0, ncol = 2, nrow = 30, dimnames = list(NULL, c('id', 'value')))
b[,1] <- sample(c(1:7), size = 30, replace = T)

I need to populate b[,2] with the values in a[,2] by matching b[,1] and
a[,1]. Does anyone know how I can do this by using hash table in Rcpp?
Thank you.


-- 
Aileen L.

View my Linkedin profile: http://au.linkedin.com/in/aileen2

 Being happy doesn't mean you're perfect. It just means you've decided to
look beyond the imperfections- K.B Indiana (age
14)<http://www.boardofwisdom.com/default.asp?topic=1010&search=K%2EB+Indiana+%28age+14%29>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130320/26b2dc16/attachment.html>


More information about the Rcpp-devel mailing list