Let's say we have
library(data.table)
dt <- data.table(Date = c(201405,201405,201504,201505, 201505,201505), ID = c(500,500,600,700,500, 700), INC = c(20,30,50,75,80,90))
return,
Date ID INC
1: 201405 500 20
2: 201405 500 30
3: 201504 600 50
4: 201505 700 75
5: 201505 500 80
6: 201505 700 90
I want to remove all IDs that are in the same Date. The return should be
Date ID INC
1: 201504 600 50
2: 201505 500 80
Could you please suggest?