| rowmean | R Documentation | 
Compute column means across rows of a numeric matrix-like object for each level of a grouping variable.
rowmean(x, group, reorder = T, na.rm = T)
| x | a matrix or data frame. | 
| group | a vector of factor giving grouping, with one element per row of x. | 
| reorder | if TRUE, then the result will be in order of  | 
| na.rm | logical (TRUE or FALSE). Should NA (including NaN) values be replaced by value 0? | 
rowmean returns a matrix or data frame containing the means. There
will be one row per unique value of group.
rowsum, rowratio
x <- matrix(runif(50), ncol = 5)
group <- sample(1:4, 10, TRUE)
xmean <- rowmean(x, group)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.