Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

format.pval

Format P Values


Description

format.pval is intended for formatting p-values.

Usage

format.pval(x, pv=x, digits = max(1, .Options$digits - 2),
            eps = .Machine$double.eps, na.form = "NA", ...)

Arguments

pv

a numeric vector.

x

argument for method compliance.

digits

how many significant digits are to be used.

eps

a numerical tolerance: see Details.

na.form

character representation of NAs.

...

arguments passed to format in the format.pval function body.

Details

format.pval is mainly an auxiliary function for print.summary.lm etc., and does separate formatting for fixed, floating point and very small values; those less than eps are formatted as “< [eps]” (where “[eps]” stands for format(eps, digits)).

Value

A character vector.

Note

This is the base format.pval function with the ablitiy to pass the nsmall argument to format

Examples

format.pval(c(runif(5), pi^-100, NA))
format.pval(c(0.1, 0.0001, 1e-27))
format.pval(c(0.1, 1e-27), nsmall=3)

Hmisc

Harrell Miscellaneous

v4.5-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>, with contributions from Charles Dupont and many others.
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.