number-formatting | R Documentation |
scales::number()
-type functionsThese functions extend the number
-type formatting
functions, with nice printing of negative numbers, optional replacement
of missing values, and vectorised formatting options.
nmbr(
x,
accuracy = 1,
scale = 1,
prefix = "",
suffix = "",
big.mark = "< >",
decimal.mark = ".",
bold = FALSE,
italic = FALSE,
html = FALSE,
na = NA_character_,
...
)
prct(
x,
percent = "%",
accuracy = 1,
prefix = "",
big.mark = "< >",
decimal.mark = ".",
bold = FALSE,
italic = FALSE,
html = FALSE,
na = NA_character_,
...
)
cmma(
x,
comma = ",",
accuracy = 1,
scale = 1,
prefix = "",
suffix = "",
decimal.mark = ".",
bold = FALSE,
italic = FALSE,
html = FALSE,
na = NA_character_,
...
)
dllr(
x,
dollar = "$",
accuracy = 1,
scale = 1,
suffix = "",
big.mark = "< >",
decimal.mark = ".",
bold = FALSE,
italic = FALSE,
html = FALSE,
na = NA_character_,
...
)
pval(
x,
accuracy = 1e-04,
min_p = accuracy,
add_p = FALSE,
decimal.mark = ".",
html = FALSE,
na = NA_character_,
...
)
create_nmbr(
accuracy = 1,
scale = 1,
prefix = "",
suffix = "",
big.mark = "< >",
decimal.mark = ".",
html = FALSE,
na = NA_character_,
...
)
x |
Numeric vector to format |
accuracy, scale, prefix, suffix, big.mark, decimal.mark, ... |
As in
|
bold, italic |
Logical scalar or vector (of the same length as x); which (if any) elements of x should be printed in bold or italic face. |
html |
Logical scalar. Whether to include formatting marks (minus
signs and narrow spaces between digits) as HTML strings ( |
na |
String scalar, replacement to use for missing values in |
percent, comma, dollar |
String scalar to use for the specific formatting method (percent sign, comma separator, dollar sign, etc). |
min_p |
Numeric scalar. The smallest p-value to print; values smaller
than this will be printed as |
add_p |
Logical scalar. Should |
For create_nmbr()
, a function with the same arguments as nmbr()
;
for other functions a character string applying the specified formatting
rules to x
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.