Hello,

I'm running into an odd behavior with data.table. Given the following
variables:

> tbl = data.table(foo=c(1,2,3), bar=c(1.1, 2.2, 3.3))
> setkey(tbl, foo)
> i = data.frame(foo=1)

... I would expect the following three ways of indexing "tbl" using "i" to
give the same result, but they don't:

> tbl[i]
   foo bar
1:   1 1.1
> tbl[J(i)]
Error in `[.data.table`(tbl, J(i)) :
  typeof x.foo (double) != typeof i.V1 (list)
> tbl[data.table(i)]
   foo bar
1:   1 1.1

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.

Thanks,

  Christian
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to