getPWseparator: Identify Separator In Pairwise Group-Names Or Find Separator...

View source: R/getPWseparator.R

getPWseparatorR Documentation

Identify Separator In Pairwise Group-Names Or Find Separator For Use With Pairwise Group-Names This function allows identifing separator used when pairwise groups are presented.

Description

Identify Separator In Pairwise Group-Names Or Find Separator For Use With Pairwise Group-Names

This function allows identifing separator used when pairwise groups are presented.

Usage

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

Arguments

compNames

(character or integer) names of pairwise combined group-names

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) if includeGrp=TRUE a list including also the group-names is returned

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Details

Note : Potential separators potSep must be at least 1 character long

The character '.' may used as separator (argument potSep), it will be protected internally for obtaining correct results when using grep(). Note : The indexing is relative to the levels of grp, thus to sorted group-names !

Cases of usage : 1) Identify separator used in concatenated labels, ie concatenated group-names are given, (only argument compNames is obligatory)

2) Suggets/Find suitable separator for given group-labels (ie a separator not occurring in any of the group-labels) when names of grp given (thus argument grp is obligatory), the first instance of potSep fitting will be chosen

Value

This function returns a character vector (length=1) of the (first) separator fitting to all data, or a list with $sep and $grpNa if includeGrp=TRUE

See Also

indexGroupsFromPW, getPWseparator, colnames of testing results from moderTestXgrp, used by replacePWseparator

Examples

## Suggest separator
getPWseparator(grp=LETTERS[1:3])
getPWseparator(grp=c("B-C","D","E")) 
getPWseparator(grp=c("B-C","D","E"), includeGrp=TRUE) 

## Identify separator used
getPWseparator(compNames=c("B-C","B-D","C-D")) 
getPWseparator(compNames=c("B-C","B-D","C-D"), includeGrp=TRUE) 

wrMisc documentation built on Nov. 18, 2026, 5:06 p.m.