Learn R Programming

afex (version 1.2-1)

round_ps: Helper functions for rounding p-values

Description

These functions return a character vector of p-values that are rounded as described below and without the leading zero before the decimal point.

Usage

round_ps(x)

round_ps_apa(x)

Value

A character vector with the same length as x.

Arguments

x

a numeric vector

Author

Henrik Singmann

Details

For round_ps p-values are rounded in a sane way: .99 - .01 to two digits, < .01 to three digits, < .001 to four digits.

For round_ps_apa p-values are rounded following APA guidelines: .999 - .001 to three digits, and < .001 for values below this threshold.

Examples

Run this code
x <- runif(10)
y <- runif(10, 0, .01)

round_ps(x)
round_ps_apa(x)

round_ps(y)
round_ps_apa(y)

round_ps(0.0000000099)
round_ps_apa(0.0000000099)

Run the code above in your browser using DataLab