title: Mutate if col name contains 'dat' to date
body: <p>I have the following df where num, chr, num</p>
  <pre><code>       dat a     idat
  1 20200101 h 20200101
  2 20200113 g 20200113
  3 20200213 b 20200213
  
  </code></pre>
  <p>I would like to get date, chr, date</p>
  <pre><code>       dat a     idat
  1 2020-01-01 h 2020-01-01
  2 2020-01-13 g 2020-01-13
  3 2020-02-13 b 2020-02-13
  </code></pre>
  <p>I tried a lot of things including:</p>
  <pre><code>df %&gt;% 
    mutate_if(vars(contains(&quot;dat&quot;)), function(x) 
      {as.Date(as.character(x), &quot;%Y%m%d&quot;)})
  </code></pre>
  <p>Does someone have a suggestion? Thanks in advance :)</p>