R/compute.combinations.R

Defines functions compute.combinations

compute.combinations <-
function(
  short.factor.structure, capacity, use.order
) { #begin function

  comb <- matrix(c(sapply(short.factor.structure,length),unlist(capacity)),ncol=2)
  if (use.order) {
    combinations <- prod(factorial(comb[,1])/(factorial((comb[,1]-comb[,2]))))
  } else {
    combinations <- prod(choose(comb[,1],comb[,2]))
  }
  
  return(combinations)

}

Try the stuart package in your browser

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

stuart documentation built on June 7, 2023, 6:12 p.m.