title: How to replace all values in selected columns with dplyr
body: <p>I was trying to figure out a way to transform all values in selected columns of my dataset using an equation $$x_i = x_{max} - x_i$$ using dplyr. I'm not sure how to correctly do this for one column, let alone multiple columns. My attempt at mutating 1 column:</p>
  <p><code>df1 &lt;- df %&gt;% mutate(column1 = replace(column1, ., x = max(column1) - x)</code></p>
  <p>My x = max(column1) - x part is not literal, I just want to know how I can implement that equation into all row entries in the column. Furthermore, how can I do this for multiple columns in the same line? Any help is appreciated. Thanks!</p>