I like to join two tables that have some identical columns (names and values) and others that are not. I\'m only interested in joining those that are not identical and I wou
Updated answer based on Arun's recommendation:
cols_old <- c('i.a', 'i.b') DT1[DT2, (cols_new) := mget(cols_old), on = c(id = "id")]
you could also generate the cols_old by doing:
cols_old
paste0('i.', gsub('_new', '', cols_new, fixed = TRUE))
See history for the old answer.