R/recombine.R

Defines functions rbind_depth_2 rbind_depth recombine.matrix recombine

recombine <- function(x, ...) {
  UseMethod("recombine")
}

#' @export
recombine.matrix <- function(x, folds, ...) {
  i <- Reduce(c, lapply(folds, function(x) x[["validation_set"]]))
  x[order(i), , drop = FALSE]
}

rbind_depth <- function(x, n) {
  Reduce(rbind, lapply(x, function(x) x[[n]]))
}

rbind_depth_2 <- function(x, n, t) {
  vals <- lapply(x, function(x) x[[n]])
  Reduce("rbind", lapply(vals, function(x) x[[t]]))
}

Try the lmtp package in your browser

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

lmtp documentation built on June 14, 2025, 1:08 a.m.