The digits
argument of describes
is used to set options(digits = digits)
.
That is, digits
specifies the minimum number of significant digits to be printed (see ?options
).
We start considering a vector of random numbers with mean=5
, sd=1
, and set digits=2
.
library(Hmisc)
oldopt <- options("digits")
set.seed(1)
dat <- rnorm(1000, mean = 5, sd = 1)
dgts <- 2
dscr <- describe(dat, digits=dgts)
options(digits = dgts)
outltx <- latex(dscr, file="describe.tex")
dvips(outltx)
options(digits = oldopt$digits)
The output is:

Here the minimum number of significant digits is 2: one digit before and one after the decimal point (for example, the 95th percentile is 6.7).
Now we consider a vector of random numbers with mean=0
, sd=0.01
, and set digits=2
.
oldopt <- options("digits")
set.seed(1)
dat <- rnorm(1000, mean = 0, sd = 0.01)
dgts <- 2
dscr <- describe(dat, digits=dgts)
options(digits = dgts)
outltx <- latex(dscr, file="describe.tex")
dvips(outltx)
options(digits = oldopt$digits)

Again, the minimum number of significant digits is 2; The median (.50
), for example, is -0.00035
, that is, it has 2 significant digits (3
and 5
).