I’ve got a dataframe that looks like
MAP name series ID
1.0 aspartame baseline 902349
1.0 aspartame baseline 82749
1.0 aspartame baseline 928542
1.0 aspartame next 928542
0.8 aspartame next 82749
0.8 aspartame next 902349
And I’d like to join this data on ID and calculate the difference
between baseline and next in the MAP score. so this should give
diff name ID
0.2 aspartame 902349
0.2 aspartame 82749
0.0 aspartame 928542
As requested by OP: A solution using
reshape(or ratherreshape2).gives