title: Unique Data Frame Based On Three Column Values
body: <p>I have a data frame of <code>6449x743</code>, in which few rows are repeating twice with same <code>column_X</code> and <code>column_Y</code> values, but with higher <code>column_Z</code> values for second repetition for the same row. I want to keep the row with higher <code>column_Z</code> only.</p>
  
  <p>I tried following, but this doesn't get rid of duplicate values and gives me output of <code>6449x743</code> only. </p>
  
  <pre><code>output &lt;- unique(Data[,c('column_X', 'column_Y', max('column_Z'))])
  </code></pre>
  
  <p>Ideally, the output should be <code>(6449 - N)x743</code>, as number of rows will be less, but number of columns will remain same, as <code>column_X</code> and <code>column_Y</code> will become unique after filtering data based on <code>column_Z</code>.</p>
  
  <p>If anyone has suggestions, please let me know. Thanks.</p>