Function formats numeric columns only. Other classes are left intact.
format_numbers(data, digits = 3, format = "f", fun = formatC, ...)
data | A data frame. |
---|---|
digits | (numeric or |
format | (character) |
fun | A function that does the formatting.
Default is |
... | Other parameters to be passed to |
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.10 3.50 1.40 0.20 setosa #> 2 4.90 3.00 1.40 0.20 setosa #> 3 4.70 3.20 1.30 0.20 setosa #> 4 4.60 3.10 1.50 0.20 setosa #> 5 5.00 3.60 1.40 0.20 setosa #> 6 5.40 3.90 1.70 0.40 setosa#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.10 3.50 1.400 0.200 setosa #> 2 4.90 3.00 1.400 0.200 setosa #> 3 4.70 3.20 1.300 0.200 setosa #> 4 4.60 3.10 1.500 0.200 setosa #> 5 5.00 3.60 1.400 0.200 setosa #> 6 5.40 3.90 1.700 0.400 setosa#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1000 3.5 1.400 0.2 setosa #> 2 4.9000 3.0 1.400 0.2 setosa #> 3 4.7000 3.2 1.300 0.2 setosa #> 4 4.6000 3.1 1.500 0.2 setosa #> 5 5.0000 3.6 1.400 0.2 setosa #> 6 5.4000 3.9 1.700 0.4 setosa