If I try to combine two data.tables that have the same column names, then .1 added to one of the names, but I seem to be unable to access the name in part j DT[] expression.
Example:
DT1 = data.table(name = letters, value = rnorm(26)) DT2 = data.table(name = letters, value = rnorm(26)) setkey(DT1, name) DT1[DT2, value.1 - value] # this doesn't work DT1[DT2][, value.1 - value] # this works
The motivation for this question was that I thought that one call would be faster, it is not, which leads to a separate question about why: Why DT1 [DT2] [, value1-value] is faster than DT1 [DT2, value1-value] on data.table with fewer columns?
source share