Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201943

Check which rows in a data.table are identical

$
0
0

I need a solution that shows me which rows are identical but I can't find a clever solution (a solution without a bunch of complex loops). I would prefer a data.table solution. What I want to have is a list with line numbers that have the identical entries.

An example:

library(data.table)
Data <- data.table(A = c("a", "a", "c"), 
                   B = c("A", "A", "B"))

The first and the second line are identical. My desired output:

[[1]]
[1] 1 2

[[2]]
[1] 3

Viewing all articles
Browse latest Browse all 201943

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>