Description Usage Arguments Details Value Author(s) Examples

Computes the column mean or median for each group of rows in a matrix.

1 2 3 |

`x` |
A numeric matrix or matrix-like object. |

`group` |
A vector or factor specifying the group assignment for each row of |

The naming scheme here is somewhat inspired by the `rowsum`

function.
Admittedly, it is rather confusing when `rowMeans`

computes the mean for a row across all columns
while `rowmean`

computes the mean for a column across a subset of rows, but there you have it.

If `group`

is a matrix, it is expected to contain soft assignment weights for each row in `x`

.
Each row of `group`

should contain non-negative values that sum to unity.
These are used to compute weighted means or medians via MatrixGenerics functions.

A numeric matrix with one row per level of `group`

,
where the value for each column contains the mean or median across the subset of rows corresponding that level.

Aaron Lun

1 2 3 4 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.