format_p {prmisc} | R Documentation |
Format a p-value according to APA standards
Description
Format a p-value according to APA standards
Usage
format_p(pvalues, decimals = 3, numbers_only = FALSE, latex = TRUE)
Arguments
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 |
Value
Character vector of length length(pvalues)
.
A string representation of the p value(s) to be used in Rmarkdown documents.
Examples
# 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)
[Package prmisc version 0.0.3 Index]