as.list.emmGrid | R Documentation |
emmGrid
objectsThese are useful utility functions for creating a compact version of an
emmGrid
object that may be saved and later reconstructed, or for
converting old ref.grid
or lsmobj
objects into emmGrid
objects.
## S3 method for class 'emmGrid'
as.list(x, model.info.slot = FALSE, ...)
as.emm_list(object, ...)
as.emmGrid(object, ...)
x |
An |
model.info.slot |
Logical value: Include the |
... |
In |
object |
Object to be converted to class |
An emmGrid
object is an S4 object, and as such cannot be saved in a
text format or saved without a lot of overhead. By using as.list
,
the essential parts of the object are converted to a list format that can be
easily and compactly saved for use, say, in another session or by another user.
Providing this list as the arguments for emmobj
allows the user
to restore a working emmGrid
object.
as.list.emmGrid
returns an object of class list
.
as.emm_list
returns an object of class emm_list
.
as.emmGrid
returns an object of class emmGrid
.
However, in fact, both as.emmGrid
and as.emm_list
check for an
attribute in object
to decide whether to return an emmGrid
or emm_list)
object.
emmobj
pigs.lm <- lm(log(conc) ~ source + factor(percent), data = pigs)
pigs.sav <- as.list(ref_grid(pigs.lm))
pigs.anew <- as.emmGrid(pigs.sav)
emmeans(pigs.anew, "source")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.