R/tensorBoot.R

Defines functions tensorBoot

Documented in tensorBoot

tensorBoot <- function(x, replace = TRUE) {
  dimx <- dim(x)
  n1 <- prod(dimx[-length(dimx)])
  n2 <- dimx[length(dimx)]
  dim(x) <- c(n1, n2)
  x <- x[, sample(1:n2, n2, replace = replace)]
  dim(x) <- dimx
  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.