R/shave.R

Defines functions shaving.default shaving.double shaving.matrix shave.list shaving shave

shave <- function(m, nbcomp) {
  UseMethod("shave")
}

shaving <- function(m, nbcomp) {
  UseMethod("shaving")
}

#' @export
shave.list <- function(m, nbcomp) {
  Map(shaving, m, nbcomp)
}

#' @export
shaving.matrix <- function(m, nbcomp) {
  m[, seq_len(nbcomp), drop = FALSE]
}

#' @export
shaving.double <- function(m, nbcomp) {
  m[seq_len(nbcomp)]
}

#' @export
shaving.default <- function(m, nbcomp) {
  m[seq_len(nbcomp)]
}

Try the RGCCA package in your browser

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

RGCCA documentation built on Oct. 9, 2023, 5:09 p.m.