adjustPVals: Adjusts a numeric vector of p-values.

View source: R/adjustPVals.R

adjustPValsR Documentation

Adjusts a numeric vector of p-values.

Description

Wraps around the R base implementation of p.adjust, as well as the methods used in the fdr tool package.

Usage

adjustPVals(pVals, adjust = "none", plotFdr = FALSE, verbose = FALSE)

Arguments

pVals

Numeric vector of p-values to adjust.

adjust

Allows for resulting p-values to be corrected for multiple hypothesis tests. Optional and some non-default choices require the "fdrtool" package. Default = "none", which means that no p-value adjustment is performed. Other options include methods in ?p.adjust (i.e., "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr"), and methods in ?fdrtool (i.e., "fndr", "pct0", "locfdr").

plotFdr

Allows for plotting of fdrtool p-value adjustment result, if this is chosen. Requires fdrtool package. Default = FALSE.

verbose

If TRUE, the function prints out the general method used for multiple correction analysis. Default = FALSE.

Value

A numeric vector of p-values that have been adjusted according to the specified method.

Examples

pvals = runif(100, 0, 1)
adj_pvals_bh = adjustPVals(pvals, adjust = "BH")
adj_pvals_hommel = adjustPVals(pvals, adjust = "hommel")

DGCA documentation built on March 31, 2023, 9:22 p.m.