I have a dataframe. I\'d like to subtract the 2nd column from all other columns. I can do it in a loop, but I\'d like to do it in one call. Here\'s my working loop cod
If you need to subtract the columns 3:ncol(df) from the second column
3:ncol(df)
df[3:ncol(df)] <- df[3:ncol(df)]-df[,2]