roundDF | R Documentation |
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.
roundDF(x, FUN = signif2, ...)
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 |
Other DataWrangling:
newNames()
,
rbindIntersect()
,
rbindUnion()
,
roundResp0()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.