50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

inlmisc (version 0.3.2)

FormatPval: Format P Values

Description

This function is intended for formatting p-values. Scientific notation is written with LaTeX commands.

Usage

FormatPval(x, digits = max(1, getOption("digits") - 2),
  eps = .Machine$double.eps, na.form = "NA", scientific = NA)

Arguments

x

'numeric'. Vector of p-values.

digits

'integer'. Number of significant digits to be used.

eps

'numeric'. Numerical tolerance; values less than eps are formatted as "< [eps]".

na.form

'character'. Value used for missing values.

scientific

'logical'. Indicates whether values should be encoded in scientific format. A missing value lets R decide whether fixed or scientific notation is used.

Value

A 'character' vector of formatted p-values.

See Also

ToScientific

Examples

Run this code
# NOT RUN {
x <- c(stats::runif(5), pi^-100, NA)
FormatPval(x)
format.pval(x)

x <- c(0.1, 0.0001, 1e-27)
FormatPval(x, scientific = TRUE)
FormatPval(x, digits = 3L, eps = 0.001)

# }

Run the code above in your browser using DataLab