object has a single grouping factor, it is returned
unchanged. Else, it is summarized by the values of the
displayLevel grouping factor (or the combination of its values
and the values of the covariate indicated in preserve, if any is
present). The collapsed data is used to produce a new
groupedData object, with grouping factor given by the
displayLevel factor.## S3 method for class 'groupedData':
collapse(object, collapseLevel, displayLevel,
outer, inner, preserve, FUN, subset, \dots)groupedData,
generally with multiple grouping factors.collapseLevel.displayLevel
grouping factor. If equal to TRUE, the displayLevel
element attr(object, "outer") is useddisplayLevel grouping
factor. If equal to TRUE, attr(object, "outer") is used
to indicate the inner covariate. An icollapseLevel grouping factor. The collapsing factor is
obtained by pasting together the levels of the object that vary within the
groups defined by collapseLevel. IngroupedData object with a single grouping factor given by the
displayLevel grouping factor, resulting from collapsing
object over the levels of the collapseLevel grouping
factor.groupedData, plot.nmGroupedData# collapsing by Dog
collapse(Pixel, collapse = 1) # same as collapse(Pixel, collapse = "Dog")Run the code above in your browser using DataLab