title: How to get a data-set with only non repeating records from a data-set which contains unique and duplicate records?
body: <p>"I'm working on a data set and would like to extract all non-repeating records into a new data-set. My current data-set have both duplicate and non-duplicate records. Is there any way to get only the unique records?  </p>
  
  <p>I have tried the below code which gave me all duplicate records.</p>
  
  <pre><code>unique &lt;- Data[!duplicated(Data),]
  NewData &lt;- unique[unique$x %in% unique$x[duplicated(unique$x)],]
  </code></pre>
  
  <p>For example I have taken the below data-set</p>
  
  <pre><code>x &lt;- c("A","B","B","D","A","C","B","A")
  y &lt;- c(1,2,3,4,5,6,7,8)
  z &lt;- c(8,7,6,5,4,3,2,1)
  Data &lt;- data.frame(x,y,z)
  
  Dataframe:
  
  x y z
  A 1 8
  B 2 7
  B 3 6
  D 4 5
  A 5 4
  C 6 3
  B 7 2
  A 8 1
  </code></pre>
  
  <p>What I want is:</p>
  
  <pre><code>x y z
  D 4 5
  C 6 3
  </code></pre>