Learn R Programming

rmdHelpers (version 1.3.1)

formatP: Format p-value

Description

A wrapper to sensibly control the printing of p-values because I was frustrated with playing with round. Calls format instead now.

Usage

formatP(p, digits = 3, scientific = FALSE, ...)

Value

Character vector of the p-value(s) formatted

Arguments

p

Numeric vector of values to be displayed

digits

Numeric of length one giving the number of digits to display. Note that if p is longer than 1, all returned values will be to the same level of precision.

scientific

Logical, should scientific notation be used?

...

Further arguments passed to format

Author

Mark Peterson

See Also

Examples

Run this code
formatP(0.049865465646)

formatP(0.00000013212354)

formatP(c(0.01564643131,.0003456463131, .45643131564), 2)

Run the code above in your browser using DataLab