pFormat: Format p-values for use in LaTeX

View source: R/pFormat.R

pFormatR Documentation

Format p-values for use in LaTeX

Description

Format p-values for use in LaTeX

Usage

pFormat(
  p,
  lev = c(0.001, 0.01, 0.05),
  asterisks = FALSE,
  ps = TRUE,
  digits = NULL
)

Arguments

p

numeric vector of p-values

lev

vector of threshold values

asterisks

logical, alternatively return asterisks at thresholds

ps

logical, if TRUE return

digits

optional, number of decimal places to round p values to if not lower than any critical threshold

Value

character vector

Examples

pFormat(0.03)
pFormat(c(0.06,0.05,0.005))
pFormat(0.02, ps = FALSE)
pFormat(0.02, asterisks = TRUE)
pFormat(0.55, digits = 1)

johngodlee/JLGMisc documentation built on June 29, 2024, 9:15 p.m.