title: How can I evaluate (or create) an on the fly column in data.table in r
body: <p>I want to create a new data.table or maybe just add some columns to a data.table. It is easy to specify multiple new columns but what happens if I want a third column to calculate a value based on one of the columns I am creating. I think plyr package can do something such as that. Can we perform such iterative (sequential) column creation in data.table? </p>
  
  <p>I want to do as follows</p>
  
  <pre><code>dt &lt;- data.table(shop = 1:10, income = 10:19*70)
  dt[ , list(hope = income * 1.05, hopemore = income * 1.20, hopemorerealistic = hopemore - 100)]  
  </code></pre>
  
  <p>or maybe </p>
  
  <pre><code>dt[ , `:=`(hope = income*1.05, hopemore = income*1.20, hopemorerealistic = hopemore-100)]
  </code></pre>