I have two data frames: (these are shortened versions of them)
A
Link VU U P
1 DVH1 7 1 37
2 DVH2 7 0 38
3 DVH3 10 1 35
B
Link VU U P
1 DVH1 2 0 15
2 DVH2 4 0 14
3 DVH3 0 0 5
I want to substract the values in data frame B from those in A based on their location. So for example: For DVH1, VU would be 7-2 (or 5), and the resulting data frame would look like:
Link VU U P
1 DVH1 5 1 22
2 DVH2 3 0 24
3 DVH3 10 1 30
See Question&Answers more detail:os