minlog10_fixzero {goat}R Documentation

-log10 transform a vector of p-values, replacing zeros with some limit/threshold

Description

-log10 transform a vector of p-values, replacing zeros with some limit/threshold

Usage

minlog10_fixzero(x, limit = 2.22e-16)

Arguments

x

p-value vector to transform to -log10

limit

value to replace zero's in x with. Set NA to replace zero's in x with the smallest finite value in x (if there is none, defaults to 2.22e-16)

Value

input parameter x transformed to -log10

Examples

  pval = c(0, 10^-6, 0.001, 0.01, 1, NA, -Inf, Inf, NaN)
  cbind(
    input = pval,
    # default; replace zeros with typical R machine precision for doubles
    minlog10_default = minlog10_fixzero(pval),
    # alternatively, replace zero with lowest non-zero pvalue in input
    minlog10_limit_from_data = minlog10_fixzero(pval, limit = NA)
  )

[Package goat version 1.0 Index]