display.parameters_model: Print tables in different output formats

View source: R/display.R

display.parameters_modelR Documentation

Print tables in different output formats

Description

Prints tables (i.e. data frame) in different output formats. print_md() is an alias for display(format = "markdown") and print_html() is an alias for display(format = "html"). A third option is display(format = "tt"), which returns a tinytable object, which is either printed as markdown or HTML table, depending on the environment.

Usage

## S3 method for class 'parameters_model'
display(object, format = "markdown", ...)

Arguments

object

An object returned by one of the package's function, for example model_parameters(), simulate_parameters(), equivalence_test() or principal_components().

format

String, indicating the output format. Can be "markdown" "html", or "tt". format = "tt" creates a tinytable object, which is either printed as markdown or HTML table, depending on the environment. See insight::export_table() for details.

...

Arguments passed to the underlying functions, such as print_md() or print_html().

Details

display() is useful when the table-output from functions, which is usually printed as formatted text-table to console, should be formatted for pretty table-rendering in markdown documents, or if knitted from rmarkdown to PDF or Word files. See vignette for examples.

Value

If format = "markdown", the return value will be a character vector in markdown-table format. If format = "html", an object of class gt_tbl. If format = "tt", an object of class tinytable.

See Also

print.parameters_model() and print.compare_parameters()

Examples


model <- lm(mpg ~ wt + cyl, data = mtcars)
mp <- model_parameters(model)
display(mp)


data(iris)
lm1 <- lm(Sepal.Length ~ Species, data = iris)
lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris)
lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris)
out <- compare_parameters(lm1, lm2, lm3)

print_html(
  out,
  select = "{coef}{stars}|({ci})",
  column_labels = c("Estimate", "95% CI")
)

# line break, unicode minus-sign
print_html(
  out,
  select = "{estimate}{stars}<br>({ci_low} \u2212 {ci_high})",
  column_labels = c("Est. (95% CI)")
)




data(iris)
data(Salamanders, package = "glmmTMB")
m1 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris)
m2 <- lme4::lmer(
  Sepal.Length ~ Petal.Length + Petal.Width + (1 | Species),
  data = iris
)
m3 <- glmmTMB::glmmTMB(
  count ~ spp + mined + (1 | site),
  ziformula = ~mined,
  family = poisson(),
  data = Salamanders
)
out <- compare_parameters(m1, m2, m3, effects = "all", component = "all")

display(out, format = "tt")

display(out, select = "{estimate}|{ci}", format = "tt")



parameters documentation built on Aug. 21, 2025, 5:47 p.m.