combineSingleT: Get All Combinations With TRUE From Each Column

View source: R/combineSingleT.R

combineSingleTR Documentation

Get All Combinations With TRUE From Each Column

Description

This function addresses the case when multiple alternatove ways exit to combine two elements. combineSingleT makes combinatory choices : if multiple TRUE in given column of 'mat' make all multiple selections with always one TRUE from each column The resultant output contains index for first and second input columns elements to be combined.

Usage

combineSingleT(mat, silent = FALSE, debug = FALSE, callFrom = NULL)

Arguments

mat

2-column matrix of logical values

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allows easier tracking of messages produced

Value

This function returns a matrix with indexes of conbinations of TRUE

Examples

## Example: Fist column indicates which boys want to dance and second column  
## which girls want to dance. So if several boys want to dance each of the girls 
## will have the chance to dance with each of them.  
matr <- matrix(c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE),ncol=2)
combineSingleT(matr)

wrMisc documentation built on March 9, 2026, 5:07 p.m.