Mean1Dim: Averages An Array Along A Dimension

View source: R/Mean1Dim.R

Mean1DimR Documentation

Averages An Array Along A Dimension

Description

Averages the array along the posdim dimension along the user specified dimension. The user can specify a subset of the dimension to take the mean along.

Usage

Mean1Dim(var, posdim, narm = TRUE, limits = NULL)

Arguments

var

Matrix to average.

posdim

Dimension to average along.

narm

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

limits

Limits to average between. Default is to take the mean along the entire dimension.

Value

Array with one dimension less than the input array, containing the average along the posdim dimension.

Author(s)

History:
0.1 - 2011-04 (V. Guemas) - Original code
1.0 - 2013-09 (N. Manubens) - Formatting to R CRAN

Examples

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

s2dverification documentation built on April 20, 2022, 9:06 a.m.