average.rows {maSigPro} | R Documentation

## Average rows by match and index

### Description

`average.rows` matches rownames of a matrix to a `match` vector and performs averaging of the rows by the index provided by an `index` vector.

### Usage

    average.rows(x, index, match, r = 0.7)

### Arguments

`x` | a matrix
`index` | index vector indicating how rows must be averaged
`match` | match vector for indexing rows
`r` | minimal correlation value between rows to compute average

### Details

rows will be averaged only if the pearson correlation coefficient between all rows of each given index is greater than r. If not, that group of rows is discarded in the result matrix.

### Value

a matrix of averaged rows

### Author(s)

Ana Conesa, aconesa@cipf.es

### Examples

    ## create data matrix for row averaging
    x <- matrix(rnorm(30), nrow = 6,ncol = 5)
    rownames(x) <- paste("ID", c(1, 2, 11, 12, 19, 20), sep = "")
    i <- paste("g", rep(c(1:10), each = 2), sep = "")  # index vector
    m <- paste("ID", c(1:20), sep = "")  # match vector
    average.rows(x, i, m, r = 0)

[Package maSigPro version 1.62.0 Index]