Learn R Programming

ribiosUtils (version 1.7.7)

replaceZeroPvalue: Replace p-values of zero

Description

Replace p-values of zero

Usage

replaceZeroPvalue(p, factor = 1)

Value

A numeric vector of the same length as the input vector, with zeros replaced by the minimal absolute double value defined by the machine multiplied by the factor.

Arguments

p

A numeric vector, containing p-values. Zero values will be replaced by a small, non-zero value.

factor

A numeric vector, the minimal p-value will be multiplied by it. Useful for pQnormScore, because there the p-value needs to be divided by two, therefore a factor of two makes sense.

Examples

Run this code
ps <- seq(0,1,0.1)
replaceZeroPvalue(ps)
replaceZeroPvalue(ps, factor=2)

Run the code above in your browser using DataLab