lowestnonzero {Tmisc}R Documentation

Lowest nonzero values

Description

Sometimes want to plot p-values (e.g., volcano plot or MA-plot), but if a statistical test returns a zero p-value, this causes problems with visualization on the log scale. This function returns a vector where the zero values are equal to the smallest nonzero value in the vector.

Usage

lowestnonzero(x)

Arguments

x

A vector of p-values between 0 and 1.

Value

A vector of p-values where zero values are exchanged for the lowest non-zero p-value in the original vector.

Examples

lowestnonzero(c(.042, .02, 0, .001, 0, .89))


[Package Tmisc version 1.0.1 Index]