R/perms.R

Defines functions Perms

Documented in Perms

#' Internal Logic Forest Functions
#'
#' INTERNAL FUNCTION TO CREATE PERMUTATIONS OF N VARIABLES
#' This function is called by \code{TTab}. It is not intended to be used independently of this function.
#' @param n integer
#' 
#' @returns mat matrix with each combination of n variables, where inclusion/exclusion is denoted by 0/1
#' @export
#' @keywords internal
#' 
Perms<-function(n)
{
  mat<-matrix(0, nrow=2^n, ncol=n)
  for(i in 1:n)
  {
    mat[,i]<-rep(0:1, times=2^(i-1), each=2^(n-i))
  }
  mat
}

Try the LogicForest package in your browser

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

LogicForest documentation built on Aug. 8, 2025, 7:46 p.m.