 <p>Ok thanks to @David Arenburg for his suggestion. I've modified it slightly to arrive at the following for my preferred solution</p> <pre><code> text &lt;- NULL for(i in 1:length(m.names)){ text &lt;- paste0(text, m.names[i], " = ", m.names[i], " + i.", m.names[i], ", ") } expr &lt;- parse(text = paste0("\":=\"(", substr(text, 1, nchar(text)-2), ")" )) res2 &lt;- DT1[data2, eval(expr)] </code></pre>