R/geo_create_batch.R

Defines functions geo_create_batch

Documented in geo_create_batch

#' @title geo_create_batch
#'
#' @description Helper function to create batch
#'
#' @inheritParams geo_create_diagnosisbatch
#'
geo_create_batch <- function(sample_metadata) {
  studylist <- list()

  for (d in unique(sample_metadata$study)) {
    studylist[[d]] <- sum(sample_metadata$study == d)
  }

  x <- seq_len(length(studylist))

  times <- sapply(names(studylist), function(n) {
    studylist[[n]]
  }, USE.NAMES = F)
  outdat <- rep(x = x, times = times)
  return(outdat)
}
miracum/clearly-sigident.preproc documentation built on June 28, 2022, 3:17 p.m.