rTensor (version 1.4.1)

modeMean-methods: Tensor Mean Across Single Mode

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(tnsr, m, drop)

# S4 method for Tensor modeMean(tnsr, m = NULL, drop = FALSE)

Arguments

tnsr

the Tensor instance

m

the index of the mode to average across

drop

whether or not mode m should be dropped

Value

K-1 or K Tensor, where K = x@num_modes

Details

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

See Also

modeSum

Examples

Run this code
# NOT RUN {
tnsr <- rand_tensor()
modeMean(tnsr,1,drop=TRUE)
# }

Run the code above in your browser using DataCamp Workspace