emm_list classAn emm_list object is simply a list of
emmGrid objects. Such a list is returned,
for example, by emmeans with a two-sided formula or a list as its
specs argument. Several methods for this class are provided, as detailed below.
Typically, these methods just quietly do the same thing as their emmGrid
methods, using the first element of the list. You can specify which
to select a different element, or just run the corresponding emmGrid
method on object[[k]].
# S3 method for emm_list
contrast(object, ..., which = NULL)# S3 method for emm_list
pairs(x, ..., which = NULL)
# S3 method for emm_list
test(object, ..., which = seq_along(object))
# S3 method for emm_list
confint(object, ..., which = seq_along(object))
# S3 method for emm_list
plot(x, ..., which = 1)
# S3 method for emm_list
coef(object, ..., which = NULL)
# S3 method for emm_list
linfct(object, ..., which = seq_along(object))
# S3 method for emm_list
str(object, ...)
# S3 method for emm_list
summary(object, ..., which = seq_along(object))
# S3 method for emm_list
print(x, ...)
# S3 method for emm_list
as.data.frame(x, ...)
# S3 method for summary_eml
as.data.frame(x, row.names = NULL, optional = FALSE,
which, ...)
a list of objects returned by the corresponding emmGrid
method (thus, often, another emm_list object). However, if
which has length 1, the one result is not wrapped in a list.
summary.emm_list returns an object
of class summary_eml, which is a list of summary_emm
objects.
The as.data.frame methods return a single data frame via
as.data.frame(rbind(x)).
See also rbind.emm_list and as.data.frame.emmGrid
an object of class emm_list
additional arguments passed to corresponding emmGrid
method. In addition, the user may include a logical argument drop
that is akin to drop and the argument of the same name in
subscripting matrices and data frames. When drop is TRUE (the
default), then when the result is a list of length 1, the
list structure is removed.
integer vector specifying which elements to select;
if NULL,
we try to guess which elements make sense. Usually, this is all elements having
names that start with ‘em’ or ‘ls’,
or the first element if no matches are found. However, in coef.emm_list,
these are the ones we exclude.
Required arguments of as.data.frame, ignored
mod <- lm(conc ~ source, data = pigs)
obj <- emmeans(mod, pairwise ~ source)
linfct(obj)
coef(obj) # done only for the contrasts
contrast(obj, "consec") # done only for the means
contrast(obj, "eff", drop = FALSE) # kept as a list
Run the code above in your browser using DataLab