R/get_comparators.R

Defines functions get_comparators.pairs get_comparators

get_comparators <- function(pairs) {
  UseMethod("get_comparators")
}

get_comparators.pairs <- function(pairs) {
  # when using compare_vars or compare_pairs, the comparator is stored
  # as an attribute in the column; retreive those
  comparators <- lapply(pairs, attr, which = "comparator")
  # remove elements without comparator
  comparators[!sapply(comparators, is.null)]
}

Try the reclin2 package in your browser

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

reclin2 documentation built on May 29, 2024, 4:21 a.m.