Let me improve and be more specific:
df <- read.table(header=T, stringsAsFactors=FALSE, text='
AccNumb Reference Amount
101a AX01 500
101a AX02 499
102b AX01 500
101a AX03 322
101a AX03 300
')
I want subset data, where AccNumb is different and reference is equal.
In this example this is:
101a AX01 500
102b AX01 500
How I can do this? Thanks!
====Original
For example, we have data.table like this:
AccNumb,Reference, Amount
001,REF1,500
002,REF1,500
001,REF2,455
001,REF3,222
I want data with AccNumb<>AccNumb and Reference==Reference
How I can do that? Thanks!