apa_p: p-value in APA format

View source: R/formatting.R

apa_pR Documentation

p-value in APA format

Description

p-value in APA format

Usage

apa_p(
  p,
  inline = FALSE,
  markdown = TRUE,
  min_digits = 2,
  max_digits = 3,
  align = FALSE
)

Arguments

p

probability

inline

If TRUE (default), returns statistic (e.g., p = .04), otherwise just the number (e.g., .04)

markdown

By default, outputs text compatible with markdown if TRUE, otherwise prints plain text compatible with latex.

min_digits

minimum number of digits to round to. Default is 2.

max_digits

maximum number of digits to round to. Default is 3.

align

decimal alignment if TRUE

Value

character vector

Examples

# Values less than .001 are <.001
apa_p(.0002)
# Values between .001 and .01 are rounded to 3 digits
apa_p(.002)
# Values between .01 and .995 are rounded to 2 digits
apa_p(.02)#'
apa_p(.22)
apa_p(.994)
# Values above .995 are >.99
apa_p(.999)
# Rounding to 3 digits
apa_p(.2341, min_digits = 3)
apa_p(.0123, min_digits = 3)
apa_p(.00123, min_digits = 3)
apa_p(.000123, min_digits = 3)
apa_p(.991, min_digits = 3)
apa_p(.9991, min_digits = 3)
apa_p(.9995, min_digits = 3)

apa7 documentation built on May 26, 2026, 5:07 p.m.