distil {cmapR} | R Documentation

## Collapse the rows or columns of a matrix using weighted averaging

### Description

This is equivalent to the 'modz' procedure used in collapsing replicates in traditional L1000 data processing. The weight for each replicate is computed as its normalized average correlation to the other replicates in the set.

### Usage

    distil(m, dimension = "col", method = "spearman")

### Arguments

`m` | a numeric matrix where the rows or columns are assumed to be replicates
`dimension` | the dimension to collapse. either 'row' or 'col'
`method` | the correlation method to use

### Value

a list with the following elements

values

  a vector of the collapsed values

correlations

  a vector of the pairwise correlations

weights

  a vector of the computed weights

### Examples

    m <- matrix(rnorm(30), ncol=3)
    distil(m)

[Package cmapR version 1.0.0 Index]