Description Usage Arguments Value Examples
Create a formattable numeric vector
1 2 | ## S3 method for class 'numeric'
formattable(x, ..., formatter = "formatC", preproc = NULL, postproc = NULL)
|
x |
a numeric vector. |
... |
arguments to be passed to |
formatter |
formatting function, formatC in default. |
preproc |
pre-processor function that prepares |
postproc |
post-processor function that transforms formatted output for printing. |
a formattable
numeric vector.
1 2 3 4 5 6 7 8 | formattable(rnorm(10), format = "f", digits = 1)
formattable(rnorm(10), format = "f",
flag="+", digits = 1)
formattable(1:10,
postproc = function(str, x) paste0(str, "px"))
formattable(1:10,
postproc = function(str, x)
paste(str, ifelse(x <= 1, "unit", "units")))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.