round_df | R Documentation |
A function to round all columns with numerical values in a data frame
round_df(df, digits = 3)
df |
a data frame with some numeric columns. Required |
digits |
the number of digits in decimal part. Defauld: 3 |
All numbers are rounded in decimal (e.g., 0.003), not scientific, format
the data frame with rounded numbers
## Not run: mtx <- data.frame(a = c("a", "b", "c"), b = c(0.123456, 1.2345678, 2.34), c = c(5.678e-3, 3.4567890, 6.789^3)) mtx round_df(mtx) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.