View source: R/format_p_value.R
format_p_value | R Documentation |
This function will round p values according to the APA guideline. It will try to round to two decimals where possible, and will try to avoid printing the value of alpha
, see Examples.
format_p_value(p, alpha = 0.05, prepend_p = FALSE)
p |
p value(s) to transform |
alpha |
the value of alpha, defaults to 0.05 |
prepend_p |
a logical to indicate whether "p =" should be prepended to the result |
A character
format_p_value(0.345678) format_p_value(0.05125) # this must not be "0.05", but is not "0.049" either, # so it will add as many decimals as needed: format_p_value(0.04993) format_p_value(c(0.123, 0.00000001)) format_p_value(c(0.123, 0.00000001), prepend_p = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.