Formatting numeric values
Function to format an R object for pretty printing with a specified (k
)
number of decimal places. The function also allows really small p-values to
be denoted as "p < 0.001"
rather than "p = 0.000"
. Note that if p.value
is set to TRUE
, the minimum value of k
allowed is 3
. If k
is set to
less than 3, the function will ignore entered k
value and use k = 3
instead.
format_num(x, k = 3L, p.value = FALSE, ...)
x |
A numeric value. |
k |
Number of digits after decimal point (should be an integer)
(Default: |
p.value |
Decides whether the number is a p-value (Default: |
... |
Currently ignored. |
Formatted numeric value.
This function is not vectorized.
format_num(0.0000123, k = 2, p.value = TRUE) format_num(0.008675, k = 2, p.value = TRUE) format_num(0.003458, k = 3, p.value = FALSE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.