How to do non-equi join with variable column name
<p>How can I do a non-equi join in data.table 1.9.7 with a variable column name? For example,</p>

<p><strong>Known column name:</strong></p>

<pre><code>library(data.table)
dt &lt;- data.table(x=round(rnorm(10)), y=rnorm(10))
binDT &lt;- data.table(LB=c(-Inf, -1, 0, .2, .7, 1.5, 3), RB=c(-1, 0, .2, .7, 1.5, 3, Inf))
dt[binDT, on=.(x&gt;=LB, x&lt;RB)]
       x       y  x.1
 1: -Inf  2.2669 -1.0
 2: -1.0 -0.5453  0.0
 3: -1.0  0.5125  0.0
 4:  0.0  1.4151  0.2
 5:  0.0 -0.1440  0.2
 6:  0.0 -1.1802  0.2
 7:  0.0  0.3338  0.2
 8:  0.0 -1.8220  0.2
 9:  0.2      NA  0.7
10:  0.7  0.3155  1.5
11:  0.7 -0.6284  1.5
12:  1.5      NA  3.0
13:  3.0      NA  Inf
</code></pre>

<p><strong>Variable column name:</strong></p>

<pre><code>colName &lt;- "x"
dt[binDT, on=.(get(colName)&gt;=LB, get(colName)&lt;RB)]  # Error
dt[binDT, on=eval(parse(text="list(x&gt;=LB, x&lt;RB)"))]  # Error
</code></pre>