wcor: Calculate weighted correlations.

Description Usage Arguments Value Author(s) Examples

View source: R/wcor.R

Description

wcor returns correlations weighted according to a provided object of class Weights.

Usage

1
wcor(X, anno, Factor, Weights)

Arguments

X

A matrix of gene expression values.

anno

A dataframe or a matrix containing the annotation of arrays in X.

Factor

A character string corresponding to a column name of anno; this should be the same used to generate Weights.

Weights

An object of class Weights or a list of weights.

Value

wcor returns a matrix.

Author(s)

Saskia Freytag

Examples

1
2
3
4
5
6
Y<-simulateGEdata(500, 500, 10, 2, 5, g=NULL, Sigma.eps=0.1, 
250, 100, intercept=FALSE, check.input=FALSE)
anno<-as.matrix(sample(1:5, dim(Y$Y)[1], replace=TRUE))
colnames(anno)<-"Factor"
weights<-findWeights(Y$Y, anno, "Factor")
wcor(Y$Y[,1:5], anno, "Factor", weights)

Example output

            [,1]       [,2]        [,3]       [,4]        [,5]
[1,]  1.00000000 -0.3257945  0.59885559 -0.3667044  0.03997998
[2,] -0.32579447  1.0000000 -0.17590341  0.2796749  0.30728301
[3,]  0.59885559 -0.1759034  1.00000000 -0.4715692  0.01317038
[4,] -0.36670438  0.2796749 -0.47156920  1.0000000 -0.10343368
[5,]  0.03997998  0.3072830  0.01317038 -0.1034337  1.00000000

RUVcorr documentation built on Nov. 8, 2020, 5:10 p.m.