roundDT: Rounds all of the numeric columns of a DT

View source: R/shiny-utils.R

roundDTR Documentation

Rounds all of the numeric columns of a DT

Description

This is a convenience function around [DT::formatRound()] that identifies all of the numeric columns and rounds them, as opposed to just rounding prespecified columns.

Usage

roundDT(x, digits = 3)

Arguments

x

a DT::datatable

digits

the number of digits to round. If NA, then no rounding is performed

Value

a rounded DT::datatable

Examples

df <- data.frame(a=rnorm(10), b=sample(letters, 10), c=rnorm(10))
roundDT(DT::datatable(df),  digits=2)

lianos/sparrow.shiny documentation built on Oct. 12, 2023, 2:43 a.m.