R/match_colors.R

Defines functions match_colors

match_colors <-
function(refClust, consClust) {
  (ttable <- table(consClust, refClust))
  (ttable <- ttable/rowSums(ttable))
  (whichMaxTable <- apply(ttable, 1, which.max))
  ans <- colnames(ttable)[whichMaxTable]
  names(ans) <- rownames(ttable)
  return(ans)
}

Try the yaConsensus package in your browser

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

yaConsensus documentation built on April 3, 2025, 10:12 p.m.