format_stat | R Documentation |
This formats numbers according to APA.
format_stat(
x,
digits = 2,
type = c("default", "p", "quotient"),
sign.positive = FALSE
)
x |
A numeric vector. |
digits |
How many digits to round the number to. |
type |
Type of statistic formatting rule to apply. "p" prints values rounded to zero as <.001, and "quotient" prints values <1 as 1/x where x is a value above 1 (e.g. in case of Bayes factors). |
sign.positive |
If |
All leading zeros are also dropped.
A character vector of formatted numbers.
Sercan Kahveci
format_stat(0.12345678)
# Proper printing of p-values
format_stat(0.0004,type="p")
# Printing of quotients where the range of values between 1 and 0
# should be considered equal to that between 1 and infinity
format_stat(0.05,type="quotient")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.