display.parameters_model | R Documentation |
Prints tables (i.e. data frame) in different output formats.
print_md()
is an alias for display(format = "markdown")
, print_html()
is an alias for display(format = "html")
. print_table()
is for specific
use cases only, and currently only works for compare_parameters()
objects.
## S3 method for class 'parameters_model'
display(
object,
format = "markdown",
pretty_names = TRUE,
split_components = TRUE,
select = NULL,
caption = NULL,
subtitle = NULL,
footer = NULL,
align = NULL,
digits = 2,
ci_digits = digits,
p_digits = 3,
footer_digits = 3,
ci_brackets = c("(", ")"),
show_sigma = FALSE,
show_formula = FALSE,
zap_small = FALSE,
font_size = "100%",
line_padding = 4,
column_labels = NULL,
include_reference = FALSE,
verbose = TRUE,
...
)
## S3 method for class 'parameters_sem'
display(
object,
format = "markdown",
digits = 2,
ci_digits = digits,
p_digits = 3,
ci_brackets = c("(", ")"),
...
)
## S3 method for class 'parameters_efa_summary'
display(object, format = "markdown", digits = 3, ...)
## S3 method for class 'parameters_efa'
display(
object,
format = "markdown",
digits = 2,
sort = FALSE,
threshold = NULL,
labels = NULL,
...
)
## S3 method for class 'equivalence_test_lm'
display(object, format = "markdown", digits = 2, ...)
print_table(x, digits = 2, p_digits = 3, theme = "default", ...)
object |
An object returned by |
format |
String, indicating the output format. Can be |
pretty_names |
Can be |
split_components |
Logical, if |
select |
Determines which columns and and which layout columns are printed. There are three options for this argument:
There are two pre-defined options for selecting columns:
It is possible to create multiple columns as well. A If
- `"ci"`: Estimates and confidence intervals, no asterisks for p-values. This is equivalent to `select = "{estimate} ({ci})"`. - `"se"`: Estimates and standard errors, no asterisks for p-values. This is equivalent to `select = "{estimate} ({se})"`. - `"ci_p"`: Estimates, confidence intervals and asterisks for p-values. This is equivalent to `select = "{estimate}{stars} ({ci})"`. - `"se_p"`: Estimates, standard errors and asterisks for p-values. This is equivalent to `select = "{estimate}{stars} ({se})"`.. - `"ci_p2"`: Estimates, confidence intervals and numeric p-values, in two columns. This is equivalent to `select = "{estimate} ({ci})|{p}"`. - `"se_p2"`: Estimate, standard errors and numeric p-values, in two columns. This is equivalent to `select = "{estimate} ({se})|{p}"`. For |
caption |
Table caption as string. If |
subtitle |
Table title (same as caption) and subtitle, as strings. If |
footer |
Can either be |
align |
Only applies to HTML tables. May be one of |
digits , ci_digits , p_digits |
Number of digits for rounding or
significant figures. May also be |
footer_digits |
Number of decimal places for values in the footer summary. |
ci_brackets |
Logical, if |
show_sigma |
Logical, if |
show_formula |
Logical, if |
zap_small |
Logical, if |
font_size |
For HTML tables, the font size. |
line_padding |
For HTML tables, the distance (in pixel) between lines. |
column_labels |
Labels of columns for HTML tables. If |
include_reference |
Logical, if |
verbose |
Toggle messages and warnings. |
... |
Arguments passed down to |
sort |
Sort the loadings. |
threshold |
A value between 0 and 1 indicates which (absolute) values
from the loadings should be removed. An integer higher than 1 indicates the
n strongest loadings to retain. Can also be |
labels |
A character vector containing labels to be added to the loadings data. Usually, the question related to the item. |
x |
An object returned by |
theme |
String, indicating the table theme. Can be one of |
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.
print_table()
is a special function for compare_parameters()
objects,
which prints the output as a formatted HTML table. It is still somewhat
experimental, thus, only a fixed layout-style is available at the moment
(columns for estimates, confidence intervals and p-values). However, it
is possible to include other model components, like zero-inflation, or random
effects in the table. See 'Examples'. An alternative is to set engine = "tt"
in print_html()
to use the tinytable package for creating HTML tables.
If format = "markdown"
, the return value will be a character
vector in markdown-table format. If format = "html"
, an object of
class gt_tbl
. For print_table()
, an object of class tinytable
is
returned.
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")
print_table(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.