This function rounds (only) the numeric
columns of a
data.frame
.
See also
Other data.frame helpers:
delete_columns_data.frame()
,
group_data.frame()
Examples
df <- data.frame("label" = c("A", "B"), "number" = rnorm(10))
round_data.frame(df, digits = 1)
#> label number
#> 1 A 1.1
#> 2 B -0.9
#> 3 A 1.2
#> 4 B 0.9
#> 5 A 0.6
#> 6 B 0.2
#> 7 A 0.3
#> 8 B -0.9
#> 9 A -3.1
#> 10 B 0.9