Construct a tibble of all pairwise contrasts between levels of a categorical variable in the sample table of a qsea::qseaSet.

makeAllContrasts(qseaSet, variable)

Arguments

qseaSet

qseaSet. Input object providing the sample table from which factor levels are taken.

variable

character(1). Column name in the sample table whose distinct levels define the contrasts. Default: none (must be supplied).

Value

A tibble with two columns:

  • group1 – the first level of the pair,

  • group2 – the second level of the pair. Each row represents one unordered pair of distinct levels (i.e., all combinations without repetition).

Details

Levels are inferred from unique(qsea::getSampleTable(qseaSet)[[variable]]). Pairs are formed between all distinct levels; no self-contrasts are included.

See also

Examples

data(exampleTumourNormal, package = "mesa")

# All pairwise contrasts among levels of 'type'
exampleTumourNormal %>%
    makeAllContrasts("type")
#> # A tibble: 10 × 2
#>    group1      group2     
#>    <chr>       <chr>      
#>  1 CRC         LUAD       
#>  2 CRC         LUSC       
#>  3 CRC         NormalColon
#>  4 CRC         NormalLung 
#>  5 LUAD        LUSC       
#>  6 LUAD        NormalColon
#>  7 LUAD        NormalLung 
#>  8 LUSC        NormalColon
#>  9 LUSC        NormalLung 
#> 10 NormalColon NormalLung