title: Conditionally replacing column values with data.table
body: <p>I have the following data.table:</p>
  
  <pre><code>dt &lt;- data.table(col1 = rep("a",6), col2 = c(1,1,1,2,3,1))
  </code></pre>
  
  <p>Now I want to replace all the 1 in col2 with value "bigDog". I can do it using the data.frame spirit:</p>
  
  <pre><code>dt$col2[dt$col2==1,] &lt;- "bigDog"
  </code></pre>
  
  <p>But I wonder if there is a different way, more <em>"data.table oriented"</em>?</p>