Description Usage Arguments Details Value Note Examples
Table value rounding
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
x |
a vector of numeric values |
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 |
Using round_half_to_even = TRUE
minimizes the expected
error when summing over rounded figures, even when the inputs are
mostly positive or mostly negative. This variant of the
round-to-nearest method is also called convergent rounding,
statistician's rounding, Dutch rounding, Gaussian rounding,
odd–even rounding, or bankers' rounding.
a character vector with rounded values
tbl_val
converts NA
values to non-missing character values.
This is because different R packages that tabulate numbers handle
true NA
values differently, but handle character values the same
way.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.