Learn R Programming

fifer (version 1.1)

pval.xtable: Convert p-values into strings with inequalities.

Description

Often times the p values are so small they must either be expressed with bajillions of digits, or in scientific notation. It is common to simply state that p<.0001, or something of the sort. This function takes a vector of p-values and converts them into characters so they can be expressed with inequalities.

Usage

pval.xtable(p.values, round.digits = 4, threshold = 1e-04, scipen = FALSE)

Arguments

p.values
A vector (or scalar) of p-values.
round.digits
How many digits should the decimals be rounded to during display?
threshold
The threshold for the inequalities. This value with then be joined with the inequality via paste. (e.g., threshold = .01 becomes "<.01")
scipen
Should scientific notation be used? Defaults to zero. (Note: it will not entirely suppress scientific notation, but will make it so extreme it will likely never happen).

Value

A vector of strings yielding the formatted p-values

Examples

Run this code
p.values = runif(100,0,1)
pval.xtable(p.values, round.digits=2, threshold=.01)
pval.xtable

Run the code above in your browser using DataLab