R duplicated returns a vector indicating whether each element of the vector or data frame is a duplicate of the element with the lower index. Therefore, if lines 3, 4 and 5 of a 5-line data frame are the same, duplicated will give me a vector
FALSE, FALSE, FALSE, TRUE, TRUE
But in this case, I really want to get
FALSE, FALSE, TRUE, TRUE, TRUE
that is, I want to know if the row next to the index is duplicated anymore .
r r-faq duplicates
Lauren Samuels Oct 21 '11 at 19:37 2011-10-21 19:37
source share