R/check.combinations.R

Defines functions check.combinations

check.combinations <- function(x, y, sep) {
  elements <- strsplit(x, split = paste0("[", sep, "]"), perl = TRUE)
  included <- sapply(elements,
    FUN = function(z) {
      ifelse(sum(z %in% y) == length(z), TRUE, FALSE)
    }
  )
  if (sum(included) != length(included)) {
    stop("Argument combination must includes network's components combinations", call. = FALSE)
  }
  included
}

Try the viscomp package in your browser

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

viscomp documentation built on Jan. 16, 2023, 5:09 p.m.