title: Is there a efficient way to mutate only on rows that meet a condition? Think mutate(when(condition))
body: <p>I am looking to apply a mutate only when certain conditions are met.</p>
  <p>I know I can do this...</p>
  <pre><code>data2 &lt;- data1 %&gt;%
     group_by(a, b) %&gt;%
     mutate(
        var1 = case_when(
           condition ~ TRUE,
           TRUE ~ FALSE,
           NA
           ),
        var2 = case_when(
           condition ~ TRUE,
           max(var28),
           var2
           ),
        var3 = case_when(
           condition ~ TRUE,
           &quot;happy&quot;,
           var3
           ),
  ...more vars here....
  )
  </code></pre>
  <p>What I would like is something that looks like this...</p>
  <pre><code>data2 &lt;- data1 %&gt;%
     group_by(a, b) %&gt;%
     mutate(
        when(condition),
        var1 = FALSE,
        var2 = max(var28),
        var3 = &quot;happy&quot;,
  ...more vars here....
  )
  </code></pre>
  <p>Unfortunately <code>mutate(across(when(condition)))</code> did not work.</p>
  <p>Any suggesions?</p>