title: Tibble/Data_frame is not rounding using mutate_if()
body: <p>I've got a <code>tibble</code> with similar characteristics to this:</p>
  
  <pre><code>set.seed(123)
  
  
  df &lt;- tibble(
    x = sample(LETTERS[1:3],10,T),
    y = rdunif(10,7.5),
    z = rdunif(10,7.5)
  ) 
  </code></pre>
  
  <p>Which yields:</p>
  
  <pre><code># A tibble: 10 x 3
     x         y     z
     &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt;
   1 A      8.00  7.00
   2 C      4.00  6.00
   3 B      6.00  5.00
   4 C      5.00  8.00
   5 C      1.00  5.00
   6 A      7.00  6.00
   7 B      2.00  5.00
   8 C      1.00  5.00
   9 B      3.00  3.00
  10 B      8.00  2.00
  </code></pre>
  
  <p>I'd like to round the numeric variables using <code>mutate_if()</code>; I'm using this code.</p>
  
  <pre><code>df %&gt;% 
    mutate_if(is.numeric, funs(round(., 1)))
  </code></pre>
  
  <p>Which yields the same as above (no rounding).</p>
  
  <pre><code># A tibble: 10 x 3
     x         y     z
     &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt;
   1 A      8.00  7.00
   2 C      4.00  6.00
   3 B      6.00  5.00
   4 C      5.00  8.00
   5 C      1.00  5.00
   6 A      7.00  6.00
   7 B      2.00  5.00
   8 C      1.00  5.00
   9 B      3.00  3.00
  10 B      8.00  2.00
  </code></pre>
  
  <p>I'm not getting any warnings, and the code seems to run fine. I just don't get the answer I'm expecting.</p>
  
  <p>ANSWER</p>
  
  <p>I wasn't asking the right question. I'm looking to limit the number of digits of numeric columns in a <code>tibble</code>. I was looking for the <code>sprintf</code> function in baseR.</p>
  
  <pre><code>df %&gt;%
    mutate_if(is.numeric, funs(sprintf("%0.1f", .)))
  </code></pre>