fmt_pvl: p-values formatter

View source: R/formatters.R

fmt_pvlR Documentation

p-values formatter

Description

Formatter for p-values, adding a symbol "<" for small p-values. Adapted directly from scales package.

Usage

fmt_pvl(
  x,
  accuracy = 0.001,
  decimal.mark = ".",
  add_p = FALSE,
  as_factor = FALSE
)

Arguments

x

A numeric vector of p-values.

accuracy

Number to round to.

decimal.mark

The character to be used to indicate the numeric decimal point.

add_p

Add "P =" before the value?

as_factor

Logical; if TRUE, a factor is returned

Value

pvalue_format returns a function with single parameter x, a numeric vector, that returns a character vector.

Examples

p <- c(.50, 0.12, .045, .011, .009, .00002, NA)
fmt_pvl(p)
fmt_pvl(p, accuracy = .01)
fmt_pvl(p, add_p = TRUE)

emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.