title: Subtracting similar column names R
body: <p>I have a dataframe with columns that have 'x1' and 'x1_fit' with the numbers going up to 5 in some cases.</p>
  
  <pre><code>date &lt;- seq(as.Date('2019-11-04'), by = "days", length.out = 7)
  x1 &lt;- c(100,120,111,152,110,112,111)
  x1_fit &lt;- c(150,142,146,148,123,120,145)
  x2 &lt;- c(110,130,151,152,150,142,161)
  x2_fit &lt;- c(170,172,176,178,173,170,175)
  
  df &lt;- data.frame(date,x1,x1_fit,x2,x2_fit)
  </code></pre>
  
  <p>How can I do x1_fit - x1 and so on. The number of x's will change every time.</p>