formatN | R Documentation |
Format (generalized) numbers in a way that their class
es
are distinguishable. Contrary to format()
which uses a
common format for all elements of x
, here, each entry is
formatted individually.
formatN(x, ...)
## Default S3 method:
formatN(x, ...)
## S3 method for class 'integer'
formatN(x, ...)
## S3 method for class 'double'
formatN(x, ...)
## S3 method for class 'bigz'
formatN(x, ...)
## S3 method for class 'bigq'
formatN(x, ...)
x |
any R object, typically “number-like”. |
... |
potentially further arguments passed to methods. |
a character vector of the same length
as x
,
each entry a representation of the corresponding entry in x
.
Martin Maechler
format
, including its (sophisticated) default method;
as.character
.
## Note that each class is uniquely recognizable from its output:
formatN( -2:5)# integer
formatN(0 + -2:5)# double precision
formatN(as.bigz(-2:5))
formatN(as.bigq(-2:5, 4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.