Learn R Programming

wrMisc (version 2.0.0)

indexGroupsFromPW: Index Names Of Groups From Vector Of Concatenated Pairwise Group-Names

Description

This function allows matching which groups are cited in a pairwise concatenated manner. This function can also be used to split concatenated group-names (while automatically determining a suitable separator) and display as matrix when includeGrp=TRUE. Replaces matchSampToPairw() ???

Usage

indexGroupsFromPW(
  compNames,
  grp = NULL,
  potSep = c("-", "---", "_", "___", ".", " ", "  ", "--", "__"),
  includeGrp = FALSE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

This function returns a numeric matrix with indexes corresponding to (sorted) group-names as they appear in compNames; or if includeGrp=TRUE a list with $ind (matrix indexes for each compNames), $GrpNames (group-names corresponding to index), $sep (separator used to split) and $grpTy (sorted names of types of groups)

Arguments

compNames

(vector of character or integer, or matrix) names of pairwise combined group-names; if matrix the rownames of compNames will be used

grp

(character or factor) optional groups (may include group-names that do not occur in compNames)

potSep

(character) potential separators to be checked if occuring in useComp; the first fitting will used

includeGrp

(logical) instead of matrix, rather return list with $ind, $GrpNames (group-names corresponding to index), $sep (separator used to split) and $grpTy

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

See Also

moderTestXgrp (colnames of testing results from this function may be used); replacePWseparator; getPWseparator used internally .getPWseparator

Examples

Run this code
indexGroupsFromPW(c("C-B","B-D","C-D")) 
indexGroupsFromPW(c("C-B","B-D","C-D"), grp=rep(LETTERS[1:6],2), includeGrp=TRUE) 

Run the code above in your browser using DataLab