Learn R Programming

popbio (version 2.4.4)

mean.list: Calculate mean matrix

Description

Calculates mean matrix from a list of matrices

Usage

# S3 method for list
mean(x, …)

Arguments

x

A list of two or more matrices

Additional arguments passed to rowMeans

Value

The mean matrix

Details

Returns the mean matrix from a list of matrices using a combination of unlist and rowMeans. See example for details.

See Also

var2

Examples

Run this code
# NOT RUN {
data(hudsonia)
mean(hudsonia)
## or
x <- matrix(unlist(hudsonia), ncol=length(hudsonia) )
matrix(rowMeans(x), 6, 6)
# }

Run the code above in your browser using DataLab