Learn R Programming

s2dverification (version 2.10.3)

MeanListDim: Averages An Array Along Multiple Dimensions

Description

Averages an array along a set of dimensions given by the argument dims.

Usage

MeanListDim(var, dims, narm = TRUE)

Arguments

var

Input array.

dims

List of dimensions to average along.

narm

Ignore NA (TRUE) values or not (FALSE).

Value

The averaged array, with the dimensions specified in dims removed.

Examples

Run this code
# NOT RUN {
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