formatP: Re-format p-values, avoiding rounding to 0

Description Usage Arguments Value Examples

View source: R/basefunctions.R

Description

formatP simplifies p-values by rounding to the maximum of p or a predefined level. Optionally < or = can be added, as well as symbols according to significance level.

Usage

1
2
3
4
5
6
7
8
formatP(
  pIn,
  ndigits = 3,
  textout = TRUE,
  pretext = FALSE,
  mark = FALSE,
  german_num = FALSE
)

Arguments

pIn

A numeric vector or matrix with p-values.

ndigits

Number of digits (default=3).

textout

Cast output to character (default=TRUE)?

pretext

Should = or < be added before p (default=FALSE)?

mark

Should significance level be added after p (default=FALSE)?

german_num

change dot (default) to comma?

Value

vector or matrix (depending on type of pIn) with type character (default) or numeric, depending on parameter textout

Examples

1
2
3
formatP(0.012345)
formatP(0.012345, ndigits = 4)
formatP(0.000122345, ndigits = 3, pretext = TRUE)

wrappedtools documentation built on Sept. 6, 2021, 5:08 p.m.