I have a dataframe (in reality I have 170 columns (85 pairs) and ~8000 rows)
data <- data.frame(A = c(6,5,4,3), B = c(2,2,2,2), C = c(9,8,7,6), D = c(2,2,2,2))
I would like to subtract column 2 from column 1, column 4 from column 3, etc. for all rows.
I think I need to either try to write a function or use apply in some way.