0

My sample data looks like

 <dataA <- matrix(c(0.74, 1.00,0.56, 0.74, 1.00,0.56, 0.74, 1.00, 0.56,0.39,  0.79, 0.35, 0.39,0.79, 0.35,   0.075,0.20,0.07, 0.18,0.33,0.16),  ncol=3,byrow=TRUE)

that produces a matrix where five rows are duplicate

> dataA
     [,1] [,2] [,3]
[1,] 0.740 1.00 0.56
[2,] 0.740 1.00 0.56
[3,] 0.740 1.00 0.56
[4,] 0.390 0.79 0.35
[5,] 0.390 0.79 0.35
[6,] 0.075 0.20 0.07
[7,] 0.180 0.33 0.16

and when I apply the duplicate function

<group1 <- dataA[duplicated(dataA),]

that results in only three duplicate rows like

> group1
<     [,1] [,2] [,3]
[1,] 0.74 1.00 0.56
[2,] 0.74 1.00 0.56
[3,] 0.39 0.79 0.35

while I need a matrix that contains all of the five duplicate rows.

Any help with this problem will be appreciated.

Hibu
  • 1
  • 4
  • @ David Arenburg I already tried that was suggested in that post : dataA[ duplicated(dataA, fromLast=TRUE),] but it does not solve my problem, it gives me same three rows as I explained above – Hibu Jul 22 '17 at 18:40
  • @ David Arenburg sorry I tried again and it worked. Thanks so much – Hibu Jul 22 '17 at 18:46

0 Answers0