getCorr: Functions to calculate correlation coefficient

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/getCorr.R

Description

Functions to calculate Pearson / Spearman correlation coefficient.

Usage

1
2
3
getCorr(x, y, rankBased = FALSE)

getAllCorWz(data, x, rankBased=FALSE, sorting=FALSE)

Arguments

x, y

A vector of expression values

data

An expression matrix with genes in the rows, samples in the columns.

rankBased

When TRUE, evaluate the Spearman's rank correlation coefficient.

sorting

Whether sort the output vector of correlation coefficients.

Details

getCorr evaluate the correlation coefficient between two vectors. It gives the same result as the generic function cor.getAllMIWz evaluates the correlation coefficients between every row in data and the given vector x. The output vector of correlation coefficients will be sorted if sorting is TRUE.

Spearman's rank correlation coefficients are calculated if rankBased is set to TRUE.

Value

getCorr returns the correlation coefficient between two vectors. getAllMIWz returns a vector of correlation coefficients between each row of data and the vector x.

Note

Missing values are not allowed as the input to the function in the current version.

Author(s)

Wei-Yi Cheng

See Also

cor for the generic functions to calculate correlation coefficients. findCorrAttractor for finding the correlation coefficient based attractors. getMI, getAllMIWz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Load the toy dataset extracted from TCGA OV data
data(ov)
#==============
# First example: find the Pearson correlation coefficients between CENPA and MELK
#==============
x <- ov["CENPA",]
y <- ov["MELK",]
mi <- getCorr(x, y)

#==============
# Second example: evaluate the Spearman correlation coefficients between 
# every gene in the dataset and CENPA
#==============
mis <- getAllCorWz(ov, x, rankBased=TRUE, sorting=TRUE)

weiyi-bitw/cafr documentation built on May 4, 2019, 4:18 a.m.