ezcor: Test correlation of each row of an object to a phenotype...

View source: R/ezcor.R

ezcorR Documentation

Test correlation of each row of an object to a phenotype vector

Description

Test correlation of each row of an object to a phenotype vector using one of several correlation methods. See examples in vignette.

Usage

ezcor(
  object,
  phenotype,
  method = "pearson",
  reorder.rows = TRUE,
  prefix = NULL,
  adjust.method = "BH",
  alternative = "two.sided",
  check.names = TRUE
)

Arguments

object

Matrix-like data object containing log-ratios or log-expression values, with rows corresponding to features (e.g. genes) and columns to samples. Must have row names that are non-duplicated and non-empty.

phenotype

Numeric vector of sample characteristics (e.g. phenotypes or treatments). Should be same length as ncol(object).

method

Character string indicating which correlation coefficient to be used for the test. One of "pearson", "kendall", or "spearman", can be abbreviated, see cor.test.

reorder.rows

Logical, should rows be reordered by p-value?

prefix

Character string to add to beginning of column names. NULL does not add a prefix.

adjust.method

Method used to adjust the p-values for multiple testing. Options, in increasing conservatism, include "none", "BH", "BY", and "holm". See p.adjust for the complete list of options. A NULL value will result in the default adjustment method, which is "BH".

alternative

Alternative hypothesis; must be one of"two.sided", "greater", or "less". You can specify just the initial letter. "greater" corresponds to positive association, "less" to negative association. See cor.test.

check.names

Logical; should names(phenotype)==rownames(object) be checked?

Value

Data frame.

See Also

limma_cor


jdreyf/ezlimma documentation built on March 3, 2024, 4:23 a.m.