Hello,

I need some help with data.table. I am trying to use data.table to do a
binary search of a large table using 2 keys.

         KEY1 KEY2 PARAM1
row1 1         2        -0.031
row2  2       8         -0.456
row3 3       24        -7.86
row4 5       2          2.89

I set the keys:
#DT<-setkey(DT,KEY1,KEY2)

Then I want to obtain do a binary search using 2 vectors E1 and E2.
#temp<-DT[list(E1,E2),]

When I do this, temp is only for the first-first, second-second,
third-third values of E1 and E2. However, I want the result of a table
search from every combination of values in E1 and E2 (1-1, 1-2, 1-3, 2-1,
2-2, 2-3, 3-1, 3-2, 3-3).

Anyone with any ideas? Thanks very much,

Evan

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to