Description Usage Arguments Value See Also Examples
Information is returned on how format(x, digits, nsmall)
would be formatted.
1 | format.info(x, digits = NULL, nsmall = 0)
|
x |
an atomic vector; a potential argument of
|
digits |
how many significant digits are to be used for
numeric and complex |
nsmall |
(see |
An integer
vector
of length 1, 3 or 6, say
r
.
For logical, integer and character vectors a single element,
the width which would be used by format
if width = NULL
.
For numeric vectors:
r[1] |
width (in characters) used by |
r[2] |
number of digits after decimal point. |
r[3] |
in |
For a complex vector the first three elements refer to the real parts, and there are three further elements corresponding to the imaginary parts.
format
(notably about digits >= 16
),
formatC
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | dd <- options("digits") ; options(digits = 7) #-- for the following
format.info(123) # 3 0 0
format.info(pi) # 8 6 0
format.info(1e8) # 5 0 1 - exponential "1e+08"
format.info(1e222) # 6 0 2 - exponential "1e+222"
x <- pi*10^c(-10,-2,0:2,8,20)
names(x) <- formatC(x, width = 1, digits = 3, format = "g")
cbind(sapply(x, format))
t(sapply(x, format.info))
## using at least 8 digits right of "."
t(sapply(x, format.info, nsmall = 8))
# Reset old options:
options(dd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.