Learn R Programming

LogicForest (version 2.1.3)

Perms: Generate All Permutations of N Variables

Description

Creates a matrix representing all possible combinations of N binary variables. Each row corresponds to a unique combination, and each column represents a variable where 1 indicates inclusion and 0 indicates exclusion.

Usage

Perms(n)

Value

A matrix with 2^n rows and n columns, where each row is a unique permutation of 0s and 1s.

Arguments

n

Integer. Number of variables to generate permutations for.

Author

Bethany Wolf wolfb@musc.edu

Details

This is an internal function called by TTab and is not intended for independent use.