Assume we have a datatable DT with multiple rows and columns
DT <- data.table(c1=1:10, c2=11:20, C3=21:30)
and we have
a <- c(1,5,7)
b <- c(2,3,1)
Is there an easy way to generate a pair-wise combination of a and b and get the following items?
DT[1,2]
DT[5,3]
DT[7,1]
i.e., I expect to get
11, 25, 7
DT[a,b] returns a 3x3 datatable which is not what I am looking for.