R/tbl.R

Defines functions round_num

Documented in round_num

#' @title Round numeric columns
#' @description Round numeric columns in a data frame.
#' @param x A data frame.
#' @param digits Number of decimal places to be used.
#' @export
round_num <- function(x, digits = 2) {
  mutate(x, across(tidyselect::vars_select_helpers$where(is.double), round, digits))
}
arnaudgallou/toolkit documentation built on Nov. 25, 2022, 5:42 p.m.