Rev 251 | Rev 4679 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% $Id: getGroups.data.frame.Rd,v 1.6 2002/03/05 14:59:39 bates Exp $\name{getGroups.data.frame}\title{Extract Groups from a Data Frame}\usage{\method{getGroups}{data.frame}(object, form, level, data, sep)}\alias{getGroups.data.frame}\arguments{\item{object}{an object inheriting from class \code{data.frame}.}\item{form}{an optional formula with a conditioning expression on itsright hand side (i.e. an expression involving the \code{|}operator). Defaults to \code{formula(object)}.}\item{level}{a positive integer vector with the level(s) of grouping tobe used when multiple nested levels of grouping are present. Defaultsto all levels of nesting.}\item{data}{unused}\item{sep}{character, the separator to use between group levels whenmultiple levels are collapsed. The default is \code{'/'}.}}\description{Each variable named in the expression after the \code{|} operator onthe right hand side of \code{form} is evaluated in \code{object}. Ifmore than one variable is indicated in \code{level} they are combinedinto a data frame; else the selected variable is returned as a vector.When multiple grouping levels are defined in \code{form} and\code{level > 1}, the levels of the returned factor are obtained bypasting together the levels of the grouping factors of level greateror equal to \code{level}, to ensure their uniqueness.}\value{either a data frame with columns given by the grouping factorsindicated in \code{level}, from outer to inner, or, when a singlelevel is requested, a factor representing the selected groupingfactor.}\author{Jose Pinheiro \email{Jose.Pinheiro@pharma.novartis.com} and Douglas Bates \email{bates@stat.wisc.edu}}\seealso{\code{\link{getGroupsFormula}}}\examples{getGroups(Pixel)getGroups(Pixel, level = 2)}\keyword{models}