modeMean: Tensor Mean Across Single Mode of DelayedArray

modeMean-methodsR Documentation

Tensor Mean Across Single Mode of DelayedArray

Description

Given a mode for a K-tensor, this returns the K-1 tensor resulting from taking the mean across that particular mode.

Usage

modeMean(darr, m = NULL, drop = FALSE)

## S4 method for signature 'DelayedArray'
modeMean(darr, m, drop)

Arguments

darr

DelayedArray object

m

the index of the mode to average across

drop

whether or not mode m should be dropped

Details

This function is an extension of the modeMean by DelayedArray.

NOTE: Sparse mode of modeMean is not available for now.

modeMean(darr, m=NULL, drop=FALSE)

Value

K-1 or K Tensor, where K = length(dim(darr))

See Also

modeSum

Examples

library("DelayedRandomArray")
darr <- RandomUnifArray(c(1,2,3))
modeMean(darr, 1, drop=FALSE)
modeMean(darr, 1, drop=TRUE)
modeMean(darr, 2)
modeMean(darr, 3)

rikenbit/DelayedTensor documentation built on Jan. 30, 2023, 6:15 p.m.