display.parameters_model | R Documentation |
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.
## S3 method for class 'parameters_model'
display(object, format = "markdown", ...)
object |
An object returned by one of the package's function, for example
|
format |
String, indicating the output format. Can be |
... |
Arguments passed to the underlying functions, such as |
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.
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
.
print.parameters_model()
and print.compare_parameters()
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.