R/setlabel.R

Defines functions setlabel

Documented in setlabel

setlabel <- function(MET, M) {
  n <- length(MET)
  p <- length(M)

  L <- matrix(0, nrow = n, ncol = p)
  colnames(L) <- names(M)

  for (i in seq_len(p)) {
    m <- unique(as.character(unlist(M[[i]])))

    for (j in seq_len(n)) {
      b <- MET[j]
      if (b %in% m) {
        L[j, i] <- 1
      }
    }
  }
  return(L)
}

Try the mseapca package in your browser

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

mseapca documentation built on Aug. 8, 2025, 7:20 p.m.