R/loo.R

Defines functions looIndex

Documented in looIndex

#' Indexes without one sample
#'
#' Performs the leave-out-one indexing
#' @param size The number of samples
#' @return A list of indices where one sample is excluded
#' @export
#' @examples
#' looIndex(15)
looIndex <- function(size){

  l <- seq_len(size)
  vl <- vector("list", length = size)
  for (i in l) {
    vl[[i]] <- l[-i]
  }
  vl
}
llrs/inteRmodel documentation built on April 1, 2022, 4:04 p.m.