R/tensorCentering.R

Defines functions tensorCentering

Documented in tensorCentering

tensorCentering <-
function(x, location = NULL){
  r <- length(dim(x)) - 1
  if(is.null(location)){
    location <- apply(x, 1:r, mean)
  }
  x <- sweep(x, 1:r, location, '-')
  attr(x, "location") <- location
  return(x)
}

Try the tensorBSS package in your browser

Any scripts or data that you put into this service are public.

tensorBSS documentation built on June 2, 2021, 9:08 a.m.