format_table | R Documentation |
This functions takes a data frame (usually with model
parameters) as input and formats certain columns into a more readable
layout (like collapsing separate columns for lower and upper confidence
interval values). Furthermore, column names are formatted as well. Note
that format_table()
converts all columns into character vectors!
format_table(
x,
pretty_names = TRUE,
stars = FALSE,
digits = 2,
ci_width = "auto",
ci_brackets = TRUE,
ci_digits = 2,
p_digits = 3,
rope_digits = 2,
ic_digits = 1,
zap_small = FALSE,
preserve_attributes = FALSE,
exact = TRUE,
use_symbols = getOption("insight_use_symbols", FALSE),
verbose = TRUE,
...
)
x |
A data frame of model's parameters, as returned by various functions
of the easystats-packages. May also be a result from
|
pretty_names |
Return "pretty" (i.e. more human readable) parameter names. |
stars |
If |
digits , ci_digits , p_digits , rope_digits , ic_digits |
Number of digits for
rounding or significant figures. May also be |
ci_width |
Minimum width of the returned string for confidence
intervals. If not |
ci_brackets |
Logical, if |
zap_small |
Logical, if |
preserve_attributes |
Logical, if |
exact |
Formatting for Bayes factor columns, in case the provided data
frame contains such a column (i.e. columns named |
use_symbols |
Logical, if |
verbose |
Toggle messages and warnings. |
... |
Arguments passed to or from other methods. |
A data frame. Note that format_table()
converts all columns
into character vectors!
options(insight_use_symbols = TRUE)
overrides the use_symbols
argument
and always displays symbols, if possible.
Vignettes Formatting, printing and exporting tables and Formatting model parameters.
format_table(head(iris), digits = 1)
m <- lm(Sepal.Length ~ Species * Sepal.Width, data = iris)
x <- parameters::model_parameters(m)
as.data.frame(format_table(x))
as.data.frame(format_table(x, p_digits = "scientific"))
model <- rstanarm::stan_glm(
Sepal.Length ~ Species,
data = iris,
refresh = 0,
seed = 123
)
x <- parameters::model_parameters(model, ci = c(0.69, 0.89, 0.95))
as.data.frame(format_table(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.