Learn R Programming

wrMisc (version 2.1.0)

convPairwiseSetup: Check Comparison-Choice

Description

This function aims to help getting organized with pairwise (statistical) testing since there are multiple ways of expressing how samples should be grouped for tests. For example this may be either as combined character strings (eg 'A-B') or as separate elements. This function takes most input-formats and returns multiple converted formats.

Usage

convPairwiseSetup(
  useComparison,
  grp,
  experSetup = NULL,
  sep = NULL,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

This function returns a list with $data, $nNA, $randParam, $NAneigLst, $seed, $filt, and $annot

Arguments

useComparison

(numeric or character vector or matrix) the argument allowing to specify the pairwise comparions may be character as result of combining two group-names (from argument grp) (eg 'A-B', beware, the separator may not appear inside group-names) or 2-column matrix of group-names (thus, without separator; names combined with separator may be shown as rownames) or 2-column matrix of indexes to sorted group-names; default setting of useComparison='all' will select all possible pairwise combinations

grp

(character or factor) vector defining groups of replicates for additional checking (may also be just the levels of grp)

experSetup

(list) optional esperimental setup (list with $ind, $pwGrpIndex,$sep and $pwGrpNa as obtained using getPairwiseSetup)

sep

(character) optional custom separator to use for splitting useComparison

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allows easier tracking of messages produced

Details

This function returns a list with $pwGrpNa (matrix with separated elements), $pwIndex (matrix with separated indexes), $grpNa (levels of grp, ie sorted), $sep (character vecor of separator found/used or suggested), $concat (pairwise concatenated names, eg 'A-B')

See Also

presenceFilt, getPWseparator, indexGroupsFromPW, getPairwiseSetup, strsplit

Examples

Run this code
convPairwiseSetup(c("B-C","D-A"), LETTERS[1:4])
convPairwiseSetup(c("B","C"), LETTERS[1:3])
convPairwiseSetup("all", LETTERS[1:3])
convPairwiseSetup(2:3, LETTERS[1:3])
convPairwiseSetup(2:3, LETTERS[1:3], sep="__")
convPairwiseSetup(matrix(c("B","D","C","A"), ncol=2), LETTERS[1:4])

Run the code above in your browser using DataLab