I want to subtract one column from another and create a new one using the corresponding suffix in the first column. I have approx 50 columns I can do it "manually" as follows...
df$new1 <- df$col_a1 - df$col_b1
df$new2 <- df$col_a2 - df$col_b2
What is the easiest way to create a loop that does the job for me?