\Header{getGroupsFormula}{Extract Grouping Formula}
\methalias{getGroupsFormula.default}{getGroupsFormula}
\methalias{getGroupsFormula.gls}{getGroupsFormula}
\methalias{getGroupsFormula.lme}{getGroupsFormula}
\methalias{getGroupsFormula.lmList}{getGroupsFormula}
\methalias{getGroupsFormula.reStruct}{getGroupsFormula}
\keyword{models}{getGroupsFormula}
\begin{Description}\relax
The conditioning expression associated with \code{formula(object)}
(i.e. the expression after the \code{|} operator) is returned either as
a named list of one-sided formulas, or a single one-sided formula,
depending on the value of \code{asList}. The components of the
returned list are ordered from outermost to innermost level and are
named after the grouping factor expression.
\end{Description}
\begin{Usage}
\begin{verbatim}
getGroupsFormula(object, asList, sep)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] any object from which a formula can be extracted.
\item[\code{asList}] an optional logical value. If \code{TRUE} the returned
value with be a list of formulas; else, if \code{FALSE} the returned
value will be a one-sided formula. Defaults to \code{FALSE}.
\item[\code{sep}] character, the separator to use between group levels when
multiple levels are collapsed.  The default is \code{'/'}.
\end{ldescription}
\end{Arguments}
\begin{Value}
a one-sided formula, or a list of one-sided formulas, with the
grouping structure associated with \code{formula(object)}. If no
conditioning expression is present in \code{formula(object)} a
\code{NULL} value is returned.
\end{Value}
\begin{Author}\relax
Jose Pinheiro \email{Jose.Pinheiro@pharma.novartis.com} and Douglas Bates \email{bates@stat.wisc.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\Link{getGroupsFormula.gls}},
\code{\Link{getGroupsFormula.lmList}},
\code{\Link{getGroupsFormula.lme}},
\code{\Link{getGroupsFormula.reStruct}},
\code{\Link{getGroups}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
getGroupsFormula(y ~ x | g1/g2)
\end{ExampleCode}
\end{Examples}

