minpRows: find the rows of a data frame with the minimum pvalue

Description Usage Arguments Value Examples

View source: R/minpRows.q

Description

find the rows of a data frame with the minimum pvalue, best used in a print or summary function to summarize a group of test statistics.

Usage

1
minpRows(obj, colnames=NULL, rowname=NULL, col.indx=ncol(obj))

Arguments

obj

a data frame for a group of statistical tests, with pvalues

colnames

new names to give to columns

rowname

new names to give the row(s). If multiple rows contain the minimum pvalue, rowname is assigned to each of them, appending a digit at the end (1, 2, etc).

col.indx

the index of the columns that contains the pvalue, default is the last column of obj

Value

a subset of the obj data.frame rows

Examples

1
2
3
4
5
6
## create a data frame of chi-square(1) tests
tests <- data.frame(pos=1:3, chitest=c(3,4,2), df=rep(1,3), 
                    pval=1-pchisq(c(3,4,2), df=1))

# find the rows of the best tests
best.tests <- minpRows(tests, colnames=c("position", "chi.test", "df","pvalue"))

ibdreg documentation built on May 30, 2017, 5:27 a.m.

Related to minpRows in ibdreg...