Rev 6562 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File nlme/man/getGroups.data.frame.Rd% Part of the nlme package for R% Distributed under GPL 2 or later: see nlme/LICENCE.note\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.}\references{Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Modelsin S and S-PLUS", Springer, esp. pp. 100, 461.}\author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}}\seealso{\code{\link{getGroupsFormula}}}\examples{getGroups(Pixel)getGroups(Pixel, level = 2)}\keyword{models}