formatInt | R Documentation |
Format an integer as a string
formatInt(
x,
big.mark = ",",
trim = TRUE,
forceInteger = TRUE,
scientific = FALSE,
...
)
x |
numeric vector or matrix |
big.mark , trim , scientific |
options sent to |
forceInteger |
logical indicating whether numeric values should
be rounded to the nearest integer value prior to |
This function is a quick wrapper function around base::format()
to display integer values as text strings. It will also return a
matrix if the input is a matrix.
character vector if x
is a vector, or if x
is a matrix
a matrix will be returned.
Other jam string functions:
asSize()
,
breaksByVector()
,
cPasteSU()
,
cPasteS()
,
cPasteUnique()
,
cPasteU()
,
cPaste()
,
fillBlanks()
,
gsubOrdered()
,
gsubs()
,
makeNames()
,
mixedOrder()
,
mixedSortDF()
,
mixedSorts()
,
mixedSort()
,
mmixedOrder()
,
nameVectorN()
,
nameVector()
,
padInteger()
,
padString()
,
pasteByRowOrdered()
,
pasteByRow()
,
sizeAsNum()
,
tcount()
,
ucfirst()
,
uniques()
x <- c(1234, 1234.56, 1234567.89);
## By default, commas are used for big.mark, and decimal values are hidden
formatInt(x);
## By default, commas are used for big.mark
formatInt(x, forceInteger=FALSE);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.