Description Usage Arguments Examples
View source: R/style_numeric.R
Take a dataframe, round the digits to the thousandths, and optionally add commas (except to year columns).
1 2 | style_numeric(df, digits = 3, add_commas = FALSE,
dont_add_commas = NULL)
|
df |
A dataframe. |
digits |
The number of digits to round decimals to. |
add_commas |
If TRUE, add commas in between 1000s. |
dont_add_commas |
A character vector of columns that should not have commas added, if add_commas is TRUE. |
1 2 3 | iris_2 <- iris %>% tibble::as_tibble()
iris_2$Sepal.Width <- iris$Sepal.Width*1e+12
iris_2 %>% style_numeric(add_commas = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.