R/allComparisons.R

Defines functions allComparisons

allComparisons <- function(x,sep=" <= "){
  n <- length(x)
  pro <- rep(x,(n-1):0)
  contra <- x[unlist(lapply(2:n,function(i)i:n))]
  out <- lapply(1:length(pro),function(i)c(pro[i],contra[i]))
  names(out) <- sapply(out,paste,collapse=sep)
  out
}

Try the pec package in your browser

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

pec documentation built on April 11, 2023, 5:55 p.m.