September 2017
Beginner to intermediate
560 pages
25h 18m
English
For this, use the duplicated() function:
> duplicated(prospect) [1] FALSE FALSE FALSE FALSE TRUE FALSE TRUE
From the data, we know that cases 2, 5, and 7 are duplicates. Note that only cases 5 and 7 are shown as duplicates. In the first occurrence, case 2 is not flagged as a duplicate.
To list the duplicate cases, use the following code:
> prospect[duplicated(prospect), ] salary family.size car 5 30000 3 Compact 7 30000 3 Compact
Read now
Unlock full access