averageRows | R Documentation |
Rearranges and averages rows according to by
.
averageRows(data, by = labels, func = mean, ...)
data |
the matrix whose rows should be averaged. |
by |
an integer or vector by which to average and/or rearrange rows. |
func |
the function to apply to the result. Default: mean. |
... |
additional arguments to be passed to |
Returns a vector or matrix of averaged rows.
Rehrauer, Hubert
Schmid, Peter
m1 = matrix(1:20,5)
averageRows(m1,c(1,1,2,2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.