groupedData
object 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, which is plotted using the
appropriate plot
method for groupedData
objects with
single level of grouping.# S3 method for nmGroupedData
plot(x, collapseLevel, displayLevel, outer, inner,
preserve, FUN, subset, key, grid, …)
nmGroupedData
,
representing a groupedData
object with multiple grouping
factors.
outer
is missing. Default is
collapseLevel
.
displayLevel
grouping factor, which are used to determine the panels of the
Trellis plot. If equal to TRUE
, the displayLevel
element attr(object, "outer")
is used to indicate the
outer covariates. An outer covariate is invariant within the sets
of rows defined by the grouping factor. Ordering of the groups is
done in such a way as to preserve adjacency of groups with the same
value of the outer variables. Defaults to NULL
, meaning that
no outer covariates are to be used.
displayLevel
grouping factor,
which is used to associate points within each panel of the Trellis
plot. If equal to TRUE
, attr(object, "outer")
is used
to indicate the inner covariate. An inner covariate can change within
the sets of rows defined by the grouping factor. Defaults to
NULL
, meaning that no inner covariate is present.
collapseLevel
grouping factor. The collapsing factor is
obtained by pasting together the levels of the collapseLevel
grouping factor and the values of the covariate to be
preserved. Default is NULL
, meaning that no covariates need to
be preserved.
object
that vary within the
groups defined by collapseLevel
. Invariant variables are
always summarized by group using the unique value that they assume
within that group. If FUN
is a single
function it will be applied to each non-invariant variable by group
to produce the summary for that variable. If FUN
is a list of
functions, the names in the list should designate classes of
variables in the data such as ordered
, factor
, or
numeric
. The indicated function will be applied to any
non-invariant variables of that class. The default functions to be
used are mean
for numeric factors, and Mode
for both
factor
and ordered
. The Mode
function, defined
internally in gsummary
, returns the modal or most popular
value of the variable. It is different from the mode
function
that returns the S-language mode of the variable.NULL
, meaning that all levels are
used.TRUE
, a legend
is included at the top of the plot indicating which symbols (colors)
correspond to which prediction levels. If FALSE
, no legend
is included. If given as a list, key
is passed down as an
argument to the trellis
function generating the plots
(xyplot
). Defaults to TRUE
.TRUE
.collapseLevel
grouping factor and grouped according to the
displayLevel
grouping factor.groupedData
, collapse.groupedData
,
plot.nfnGroupedData
, plot.nffGroupedData
# no collapsing, panels by Dog
plot(Pixel, display = "Dog", inner = ~Side)
# collapsing by Dog, preserving day
plot(Pixel, collapse = "Dog", preserve = ~day)
Run the code above in your browser using DataLab