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.
Usage
format_num(x, k = 2L, p.value = FALSE, ...)
Arguments
x
A numeric value.
k
Number of digits after decimal point (should be an integer)
(Default: k = 3L).
p.value
Decides whether the number is a p-value (Default: FALSE).