multi_compare: a container for performing two or more sample test.

Description Usage Arguments Value Author(s) Examples

View source: R/diff-analysis-utilities.R

Description

a container for performing two or more sample test.

Usage

1
2
3
4
5
6
7
8
multi_compare(
  fun = wilcox.test,
  data,
  feature,
  factorNames,
  subgroup = NULL,
  ...
)

Arguments

fun

character, the method for test, optional ""

data

data.frame, nrow sample * ncol feature+factorNames.

feature

vector, the features wanted to test.

factorNames

character, the name of a factor giving the corresponding groups.

subgroup

vector, the names of groups, default is NULL.

...,

additional arguments for fun.

Value

the result of fun, if fun is wilcox.test, it will return the list with class "htest".

Author(s)

Shuangbin Xu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
datest <- data.frame(A=rnorm(1:10,mean=5),
                     B=rnorm(2:11, mean=6), 
                     group=c(rep("case",5),rep("control",5)))
head(datest)
multi_compare(fun=wilcox.test,data=datest,
              feature=c("A", "B"),factorNames="group")
da2 <- data.frame(A=rnorm(1:15,mean=5),
                  B=rnorm(2:16,mean=6),
                  group=c(rep("case1",5),rep("case2",5),rep("control",5)))
multi_compare(fun=wilcox.test,data=da2,
              feature=c("A", "B"),factorNames="group",
              subgroup=c("case1", "case2"))

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.