R/cv_indexation.mode_distribute.R

Defines functions cv_indexation.mode_distribute

cv_indexation.mode_distribute <- function(X, y, nfolds, indexation.mode, model_function, ...) {

       X <- data.frame(X, check.names = TRUE, stringsAsFactors = TRUE)

       if (indexation.mode == "dimension") {
               out <- cv_MD_indexed(X, y, nfolds, model_function, ...)
       } else {
               if (indexation.mode == "GIC") {
                       out <- cv_GIC_indexed(X, y, nfolds, model_function, ...)
               } else {
                       stop("Error: wrong indexation.mode, should be one of: GIC, dimension")
               }
       }

       out$indexation.mode <- indexation.mode
       out$call <- match.call()
       class(out) <- "cv.DMR"

       return(out)
}

Try the DMRnet package in your browser

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

DMRnet documentation built on Aug. 7, 2023, 5:11 p.m.