[R] Help with data.table
francois.morneau at ign.fr
Wed Mar 1 08:56:17 CET 2017
Not sure but have you consider using :
that will create a data.frame of all combinations of your two vectors
and then use it for your search.
Le 01/03/2017 à 08:27, Evan Kransdorf a écrit :
> 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:
> Then I want to obtain do a binary search using 2 vectors E1 and 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,
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help