format_p | R Documentation |
Format a p-value according to APA standards
format_p(pvalues, decimals = 3, numbers_only = FALSE, latex = TRUE)
pvalues |
The p-values |
decimals |
The number of decimals to be printed |
numbers_only |
Logical, indicates whether the p-values
should be printed without the accompanying p.
Defaults to |
latex |
Logical, indicates whether the p-values should be printed with
or without |
Character vector of length length(pvalues)
.
A string representation of the p value(s) to be used in Rmarkdown documents.
# Format a p-value, default is 3 decimals
format_p(0.03123)
format_p(0.000001231)
format_p(0.000001231, decimals = 2)
format_p(0.3123, decimals = 2)
format_p(0.3123, latex = FALSE)
# Format several p-values with one function call
format_p(c(0.3123, 0.001, 0.00001, 0.19))
format_p(c(.999, .9999, 1))
format_p(c(0.3123, 0.001, 0.00001, 0.19, .99999), numbers_only = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.