title: How can assign values to rows with unique values?
body: <p>For example I have:</p>
  <pre><code>df[1,] &lt;- c('a','b','c')
  df[2,] &lt;- c('h','a','f')
  df[3,] &lt;- c('d','e','g')
  df[4,] &lt;- c('h','a','g')
  </code></pre>
  <p>Lets say I want to create a new column that groups the data by uniqueness for the first 2 values in each row for the first 2 columns. So the final result would look like:</p>
  <pre><code>df[1,] &lt;- c('a','b','c',1)
  df[2,] &lt;- c('h','a','f',2)
  df[3,] &lt;- c('d','e','g',3)
  df[4,] &lt;- c('h','a','g',2)
  </code></pre>
  <p>How would I go about this?</p>