Hello,<br><br>I'm running into an odd behavior with data.table. Given the following variables:<br><br>> tbl = data.table(foo=c(1,2,3), bar=c(1.1, 2.2, 3.3))<br>> setkey(tbl, foo)<br>> i = data.frame(foo=1)<br>
<br>... I would expect the following three ways of indexing "tbl" using "i" to give the same result, but they don't:<br><br>> tbl[i]<br> foo bar<br>1: 1 1.1<br>> tbl[J(i)]<br>Error in `[.data.table`(tbl, J(i)) :<br>
typeof x.foo (double) != typeof i.V1 (list)<br>> tbl[data.table(i)]<br> foo bar<br>1: 1 1.1<br><br>Anything I'm missing on why tbl[J(i)] wouldn't work like the other two? Or have I hit a bug? I'm running R 2.15.1 64bit on Windows 7, with data.table 1.8.2.<br>
<br>Thanks,<br><br> Christian<br><br>