Description Usage Arguments Value Examples
Table strings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | tbl_string(
...,
.sep = "",
.envir = parent.frame(),
round_half_to_even = FALSE,
breaks = c(1, 10, Inf),
decimals = c(2, 1, 0),
miss_replace = "--",
big_mark = ",",
big_interval = 3L,
small_mark = "",
small_interval = 5L,
decimal_mark = getOption("OutDec"),
zero_print = NULL,
trim = TRUE
)
|
... |
Strings to format. Multiple inputs are concatenated together before formatting. Named arguments are not supported. |
.sep |
Separator used to separate elements |
.envir |
environment to evaluate each expression in. |
round_half_to_even |
a logical value. If |
breaks |
a positive, monotonically increasing numeric vector
designating rounding boundaries. With |
decimals |
a numeric vector of equal length to |
miss_replace |
a character string that replaces missing values. |
big_mark |
a character value used to separate number groups to the left of the decimal point. See prettyNum for more details on this. Set this input to ” to negate it's effect. |
big_interval |
a numeric value indicating the size of number groups for numbers before (hence big) the decimal. |
small_mark |
a character value used to separate number groups to the right of the decimal point. |
small_interval |
a numeric value indicating the size of number groups for numbers after (hence small) the decimal. |
decimal_mark |
the character to be used to indicate the numeric decimal point. |
zero_print |
a logical value, character string or NULL value specifying if and how zeros should be formatted specially. Useful for pretty printing 'sparse' objects. |
trim |
a logical value; if |
a character vector
1 2 3 4 5 6 7 8 9 10 11 12 13 | x <- runif(10)
y <- runif(10)
tbl_string("{x} / {y} = {x/y}")
tbl_string("{x}", "({100 * y}%)", .sep = ' ')
df = data.frame(x = 1:10, y=1:10)
tbl_string("{x} / {y} = {as.integer(x/y)}", .envir = df)
tbl_string("{x} / {y} = {as.integer(x/y)}", .envir = NULL)
with(df, tbl_string("{x} / {y} = {as.integer(x/y)}"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.