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)

Arguments

mat

2-column matrix of logical values

Value

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 Jan. 7, 2023, 1:27 a.m.