roundDF: Report numbers with a fixed formatting.

View source: R/roundDF.R

roundDFR Documentation

Report numbers with a fixed formatting.

Description

sigdigs is a wrapper that rounds whatever numeric in a data.frame (because round(df) returns an error if df contains non-numerics). You often want to run this function before creating a csv file as output.

Usage

roundDF(x, FUN = signif2, ...)

Arguments

x

a numeric vector or a data.frame with some of the columns numeric.

FUN

the rounding function to apply to numeric columns.

...

Arguments passed to FUN

See Also

Other DataWrangling: newNames(), rbindIntersect(), rbindUnion(), roundResp0()

Examples

df1 <- data.frame(obs=letters[1:3],x1=rnorm(3),x2=c(1.24/1e4,1.1334e6,1.1),x3=1:3)
roundDF(df1,digits=3)

philipdelff/pmxtricks documentation built on Nov. 11, 2024, 5:16 p.m.