R/tabularise.glm.R
tabularise_default.glm.Rd
Create a rich-formatted table from a glm object
# S3 method for class 'glm'
tabularise_default(
data,
header = FALSE,
title = header,
equation = header,
auto.labs = TRUE,
origdata = NULL,
labs = NULL,
footer = FALSE,
lang = getOption("SciViews_lang", default = Sys.getenv("LANGUAGE", unset = "en")),
...,
kind = "ft",
env = parent.frame()
)
A glm object
Logical. If TRUE
(FALSE
by default), a header is added to the table.
The header includes both the title and the equation (if applicable).
If set to FALSE
, neither the title nor the equation will be displayed in
the table header, even if the title
or equation
parameters are provided.
If TRUE
(FALSE
by default), add a title to the table header. Default to the same
value than header, except outside of a chunk where it is FALSE
if a table
caption is detected (tbl-cap
YAML entry).
Logical or character. Controls whether an equation is added to the table header and how parameters are used. Accepted values are:
TRUE
: The equation is generated and added to the table header. Its
parameters are also used in the "Term" column.
FALSE
(by default): No equation is generated or displayed, and its
parameters are not used in the "Term" column.
NA
: The equation is generated but not displayed in the table header.
Its parameters are used in the "Term" column.
Character string: A custom equation is provided directly and added to the table header.
If TRUE
(by default), use labels (and units) automatically
from data or origdata=
.
The original data set this model was fitted to. By default it
is NULL
and no label is used.
Labels to change the names of elements in the term
column of
the table. By default it is NULL
and nothing is changed.
If TRUE
(FALSE
by default), add a footer to the table
The natural language to use. The default value can be set with,
e.g., options(SciViews_lang = "fr")
for French.
Additional arguments
The kind of table to produce: "tt" for tinytable, or "ft" for flextable (default).
The environment where to evaluate formulas (you probably do not need to change the default).
A flextable object is returned. You can print it in different formats (HTML, LaTeX, Word, PowerPoint) or rearrange it with the {flextable} functions.
iris_glm <- glm(data = iris, Petal.Length ~ Sepal.Length)
tabularise::tabularise(iris_glm)
Term
Estimate
Intercept
-7.10
Sepal.Length
1.86
tabularise::tabularise(iris_glm, header = TRUE, footer = TRUE)
Generalized Linear Model
Term
Estimate
-7.10
1.86
Degrees of Freedom: 149 Total (i.e. no model); 148 Residual
Total deviance: 464.3
Residual deviance: 111.5 AIC: 387.1
tabularise::tabularise(iris_glm, header = TRUE, footer = FALSE)
Generalized Linear Model
Term
Estimate
-7.10
1.86
tabularise::tabularise(iris_glm, header = TRUE, equation = NA,footer = TRUE)
Generalized Linear Model
Term
Estimate
-7.10
1.86
Degrees of Freedom: 149 Total (i.e. no model); 148 Residual
Total deviance: 464.3
Residual deviance: 111.5 AIC: 387.1