Learn R Programming

radiant.data (version 1.4.5)

round_df: Round doubles in a data.frame to a specified number of decimal places

Description

Round doubles in a data.frame to a specified number of decimal places

Usage

round_df(tbl, dec = 3)

Value

Data frame with rounded doubles

Arguments

tbl

Data frame

dec

Number of decimals to show

Examples

Run this code
data.frame(x = as.factor(c("a", "b")), y = c(1L, 2L), z = c(-0.0005, 3.1)) %>%
  round_df(dec = 2)

Run the code above in your browser using DataLab