Learn R Programming

s2dverification (version 2.4.0)

MeanListDim: Averages A Matrix Along Various Dimensions

Description

Averages the matrix var along a set of dimensions given by the argument dims.

Usage

MeanListDim(var, dims, narm = TRUE)

Arguments

Value

Matrix with as many dimensions less than the input matrix as provided by the list dims and containing the average along this list of dimensions.

Examples

Run this code
a <- array(rnorm(24), dim = c(2, 3, 4))
print(a)
print(Mean1Dim(a, 2))
print(MeanListDim(a, c(2, 3)))

Run the code above in your browser using DataLab