calculate_gene_cor: Calculate Correlation Coefficient from an Expression Matrix

Description Usage Arguments Value Examples

Description

calculate_gene_cor() takes an expression matrix. Two genes will be selected by column/row names and Pearson's correlation will be calculated by cor().

Usage

1
2
calculate_gene_cor(data, gene1, gene2, use.row = FALSE,
  method = "pearson")

Arguments

data

a matrix or data.frame

gene1, gene2

a character string gene name that's used as a column name in the expression matrix

use.row

by default FALSE, if TRUE, calculate_gene_cor will take row names as gene names; if FALSE, column names will be seens as gene names

method

a character string indicating which correlation coefficient to compute (Options: "pearson" (default), "kendall", or "spearman")

Value

a number

Examples

1
2
3
genedf <- data.frame("a" = c(1:10),
                     "b" = c(6:15))
calculate_gene_cor(genedf, "a", "b")

chenyenchung/genofeatutil documentation built on May 15, 2019, 10:38 p.m.