mtCorrectDF: Perform multiple testing correction on a data frame column

View source: R/multiple_testing.R

mtCorrectDFR Documentation

Perform multiple testing correction on a data frame column

Description

This function orders a data frame based on a column of p-values, performs multiple testing on the column, and filters the data-frame based on it.

Usage

mtCorrectDF(
  df,
  mtMethod = c("BY", "holm", "hochberg", "hommel", "bonferroni", "BH", "fdr", "none"),
  colStr = "pval",
  newColStr = "pvalAdj",
  pvalThr = 0.05,
  doOrder = TRUE,
  nComp = nrow(df)
)

Arguments

df

A data frame with a p-values column.

mtMethod

Multiple testing correction method. Choices are 'BY' (default) 'holm', hochberg', hommel', 'bonferroni', 'BH', 'fdr' and 'none'.

colStr

Name of the column of p-values.

newColStr

Name of the column of adjusted p-values that will be created.

pvalThr

p-value threshold used for filtering. If NULL, no filtering will be performed.

doOrder

Whether to increasingly order the data frame based on the adjusted p-values.

nComp

Number of comparisons. In most situations, this parameter should not be changed.

Value

A data frame with the p-value column corrected for multiple testing.

Examples

df <- data.frame(elem = c('A', 'B', 'C', 'D', 'E'),
pval = c(0.032, 0.001, 0.0045, 0.051, 0.048))
mtCorrectDF(df)


LISTO documentation built on April 25, 2026, 5:06 p.m.