The unique id is based on the combination of the DS.ID and the OP.ID, so that DS.ID can be repeated but the combination of DS.ID and OP.ID will not. I want to find the instances where P.ID changes. Also, the combination of DS.ID and OP.ID will not necessarily be in the same row.
So, first I'd rbind to create a dataframe, then I'd want to melt with dcast. I'd want to end up with columns of DS.ID and OP.ID as the unique ID, and then columns of both dates wit the values for each one.
df12 <- rbind.fill(df1,df2)
Solution
If all you want is to compare when there is a difference in P.ID, you can just merge by the two common columns, and then compare: