I have two data frames:
>dfMapping
Name Number
a 10
b 20
c 15
>dfMapping2
Name Total Type
a 112 x
a 20 y
a 1 z
b 10 x
b 120 z
c 11 z
c 100 x
From dfMapping2 I want only those rows where dfMapping2$Total > dfMapping$Number and the final Total should have Total - dfMapping$Number. So, here the result should be:
>result
Name Total Type
a 102 x
a 10 y
b 100 z
c 85 x
Can someone help me on this?
Thanks.