Combines mutate_at()
and as_formatted_number()
format_numbers_at(.tbl, .vars, decimal_places = 1, remove_trailing_zeroes = T)
A data frame
A vars() list of symbolic columns
Decimal places to display
If the required decimal places are less than decimal places, should resulting trailing zeros be removed?
Value of mutate_at
# NOT RUN {
library(tibble)
library(magrittr)
library(dplyr)
tibble(a=c(0.1, 0.238546)) %>%
format_numbers_at(vars(a))
# }
Run the code above in your browser using DataLab