tests/testthat/helper-stack.R

stack_slice <- function(x, axis, i) {
  index <- lapply(dim(x), seq_len)
  index[[axis]] <- i
  x <- do.call(`[`, c(list(x), index, list(drop = FALSE)))
  rray_remove_axes(x, axis)
}

Try the rray package in your browser

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

rray documentation built on Nov. 17, 2026, 5:07 p.m.