# Manipulate value of adjacent element on table

My question is that how can we from the old table (2 column and a bunch of rows) create a new table (2 column also) in which the first value of the new column is the difference between the second and the third value of the first old column. And the first value of the second new column is the average value of the second and third of the second old column. For example, I have the old table which is:

old={{7,9},{2,5},{3,7},{10,9}}


then the new table should be:

new={{-5,7},{1,6},{7,8}}


I would really appreciate it if you could help me out. Thank you

Since you want a column of differences and a column of moving averages I think it is more intuitive to simply use functions with those names:

Transpose[{Differences[old[[All, 1]]], MovingAverage[old[[All, 2]], 2]}]


{{-5, 7}, {1, 6}, {7, 8}}

Transpose[{Differences@#, Mean /@ Partition[#2, 2, 1]} & @@ Transpose[old]]


{{-5, 7}, {1, 6}, {7, 8}}

Another variant:

Transpose@ MapThread[#1@#2 &, {{Differences, MovingAverage[#, 2] &}, Transpose[old]}]