Learn R Programming

wrMisc (version 2.1.0)

findHeadAndTail: Find Group-Names In Pairwise Combined And Isolate Separator

Description

This function allows mapping which group-names are occuring either as head or as tail in pairwise combined terms (by checking from tails).

Usage

findHeadAndTail(
  grpNa,
  pairwNa,
  reportAs = "list",
  sortGrp = TRUE,
  rmAmbig = TRUE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

This function returns a list containing $sep a character vector of the separator(s) identified

Arguments

grpNa

(character) the names of the groups of replicates (ie conditions) used to test

pairwNa

(character) the names of pairwise-testing (ie 'concatenated' sampNa

reportAs

(character) default 'reportAs=list' to return list, otherwise a character vector with separator(s) found will be returned

sortGrp

(logical) by default groups will be sorted (as levels of a factor appear sorted)

rmAmbig

(logical) remove all ambiguous

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Details

This function aims identifying the separator used wo create pairwise comparison labels by looking for given group-names at head and tail of combined labels. If labeles occur inside oyther ones (eg 'AB' in 'ABC') it will always privilidge the longest one. After stripping off all group-names the remaining charachers are considered as the separator used. The function will also check if all pairwise labels returned the same separtator and in case of multiple separators found the most frequent may be reytained.

See Also

(for running multiple pair-wise test) moderTestXgrp, used underneith grep

Examples

Run this code
findHeadAndTail(LETTERS[4:2], c("D-X","D-C"))

grp1 <- c("C","ACC","CC","B.B","B.BA","B","CA")
pwNa1 <- "B.B-CC" 
findHeadAndTail(grp1, pwNa1)

pwNa2 <- c("B.B-CC", "CA-ACC")
findHeadAndTail(grp1, pwNa2)

Run the code above in your browser using DataLab