title: Select only one row from a group in a data.table
body: <p>I am  having a data table which contains multiple rows with same group like below.</p>
  
  <pre><code>a=data.table(q=c(1,1,1,2,2,2,3,3,3),r=c(1,1,1,1,1,1,1,1,1),s=c(1,3,1,3,1,3,1,3,1),t=c(1,2,3,1,2,3,1,2,3))
  </code></pre>
  
  <p>From this I want only one unique row from the group q,r,s.
  I tried </p>
  
  <pre><code>unique(a)
     q r s t
  1: 1 1 1 1
  2: 1 1 3 2
  3: 1 1 1 3
  4: 2 1 3 1
  5: 2 1 1 2
  6: 2 1 3 3
  7: 3 1 1 1
  8: 3 1 3 2
  9: 3 1 1 3
  </code></pre>
  
  <p>which returns the unique rows over all but not one from the group.</p>
  
  <pre><code> a[!duplicated(a$q,a$r,a$s)]
     q r s t
  1: 1 1 1 1
  2: 1 1 3 2
  3: 1 1 1 3
  4: 2 1 3 3
  5: 3 1 1 3
  </code></pre>
  
  <p>when I try this one I loose the row</p>
  
  <pre><code>   3 1 3 2
  </code></pre>
  
  <p>My  desired output is something like </p>
  
  <pre><code>   q r s t
  1: 1 1 1 1
  2: 1 1 3 2
  3: 2 1 3 1
  4: 2 1 1 2
  5: 3 1 1 1
  6: 3 1 3 2
  </code></pre>
  
  <p>Any help is appreciated.</p>