% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/findHeadAndTail.R
\name{findHeadAndTail}
\alias{findHeadAndTail}
\title{Find Group-Names In Pairwise Combined And Isolate Separator}
\usage{
findHeadAndTail(
  grpNa,
  pairwNa,
  reportAs = "list",
  sortGrp = TRUE,
  rmAmbig = TRUE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)
}
\arguments{
\item{grpNa}{(character) the names of the groups of replicates (ie conditions) used to test}

\item{pairwNa}{(character) the names of pairwise-testing (ie 'concatenated' \code{sampNa}}

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

\item{sortGrp}{(logical) by default groups will be sorted (as levels of a factor appear sorted)}

\item{rmAmbig}{(logical) remove all ambiguous}

\item{silent}{(logical) suppress messages}

\item{debug}{(logical) additional messages for debugging}

\item{callFrom}{(character) allow easier tracking of messages produced}
}
\value{
This function returns a list containing $sep a character vector of the separator(s) identified
}
\description{
This function allows mapping which group-names are occuring either as head or as tail in pairwise combined terms (by checking from tails).
}
\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.
}
\examples{
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)
}
\seealso{
(for running multiple pair-wise test) \code{\link{moderTestXgrp}}, used underneith \code{\link[base]{grep}}
}
