Tuesday, 6 August 2013

Match rows and subtract columns

Match rows and subtract columns

I have 2 datasets having the same columns and different number of rows.
##bigdf
X Y Z
A 5 6 8
B 10 3 7
C 1 2 8
D 5 3 4
E 12 2 21
##smalldf
X Y Z
A 2 4 3
C 1 2 2
E 3 4 1
I would like to match the similar rows and subtract the Y column. I know
this is a quite simple task but I wasn't able to do it! should I be using
match()? or some sort of apply() function here?
Thanks,

No comments:

Post a Comment