rowMeans {psichomics} | R Documentation

## Calculate mean or variance for each row of a matrix

### Description

Calculate mean or variance for each row of a matrix

### Usage

    rowMeans(mat, na.rm = FALSE)

    rowVars(mat, na.rm = FALSE)

### Arguments

`mat` | Matrix
`na.rm` | Boolean: remove missing values (`NA`)?

### Value

Vector of means or variances

### Examples

    df <- rbind("Gene 1"=c(3, 5, 7), "Gene 2"=c(8, 2, 4), "Gene 3"=c(9:11))
    rowMeans(df)
    rowVars(df)

[Package psichomics version 1.12.1 Index]