Re: [R] data.table: reference column in "i"-part by column name in string object

2019-02-21 Thread Pascal A. Niklaus
On 21.02.19 20:43, Rui Barradas wrote: Hello, I don't understand the question. Like this? xx <- "B" yy <- "D" a[xx, on = v] a[c(xx, yy), on = v] Note that .(xx, yy) doesn't work. It outputs something else. Could you give an example of more complicated expressions you have doubts with? Let'

Re: [R] data.table: reference column in "i"-part by column name in string object

2019-02-21 Thread Rui Barradas
Hello, I don't understand the question. Like this? xx <- "B" yy <- "D" a[xx, on = v] a[c(xx, yy), on = v] Note that .(xx, yy) doesn't work. It outputs something else. Could you give an example of more complicated expressions you have doubts with? Hope this helps, Rui Barradas Às 14:10 de

[R] data.table: reference column in "i"-part by column name in string object

2019-02-21 Thread Pascal A. Niklaus
I am converting data.frame-based code to data.table, for performance reasons. Is there a way to refer to columns using expressions in the "i"-part? Here is an example: a <- data.table(x=rep(LETTERS[1:10],each=2), y=1:20) v <- "x" For the j-part, I can access the column whose name is stored in