Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xtable.emmGrid

Using xtable for EMMs


Description

These methods provide support for the xtable package, enabling polished presentations of tabular output from emmeans and other functions.

Usage

## S3 method for class 'emmGrid'
xtable(x, caption = NULL, label = NULL, align = NULL,
  digits = 4, display = NULL, auto = FALSE, ...)

## S3 method for class 'summary_emm'
xtable(x, caption = NULL, label = NULL,
  align = NULL, digits = 4, display = NULL, auto = FALSE, ...)

## S3 method for class 'xtable_emm'
print(x, type = getOption("xtable.type", "latex"),
  include.rownames = FALSE, sanitize.message.function = footnotesize, ...)

Arguments

x

Object of class emmGrid

caption

Passed to xtableList

label

Passed to xtableList

align

Passed to xtableList

digits

Passed to xtableList

display

Passed to xtableList

auto

Passed to xtableList

...

Arguments passed to summary.emmGrid

type

Passed to print.xtable

include.rownames

Passed to print.xtable

sanitize.message.function

Passed to print.xtable

Details

The methods actually use xtableList, because of its ability to display messages such as those for P-value adjustments. These methods return an object of class "xtable_emm" – an extension of "xtableList". Unlike other xtable methods, the number of digits defaults to 4; and degrees of freedom and t ratios are always formatted independently of digits. The print method uses print.xtableList, and any ... arguments are passed there.

Value

The xtable methods return an xtable_emm object, for which its print method is print.xtable_emm .

Examples

pigsint.lm <- lm(log(conc) ~ source * factor(percent), data = pigs)
pigsint.emm <- emmeans(pigsint.lm, ~ percent | source)
xtable::xtable(pigsint.emm, type = "response")

emmeans

Estimated Marginal Means, aka Least-Squares Means

v1.6.0
GPL-2 | GPL-3
Authors
Russell V. Lenth [aut, cre, cph], Paul Buerkner [ctb], Maxime Herve [ctb], Jonathon Love [ctb], Hannes Riebl [ctb], Henrik Singmann [ctb]
Initial release
2021-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.