Skip to contents
loading...

Create a rich-formatted table with the 'glance' information from an lm object.

Usage

# S3 method for lm
tabularise_glance(
  data,
  header = TRUE,
  title = NULL,
  equation = TRUE,
  auto.labs = TRUE,
  origdata = NULL,
  labs = NULL,
  lang = getOption("data.io_lang", "en"),
  ...,
  kind = "ft",
  env = parent.frame()
)

Arguments

data

An lm object

header

If TRUE (by default), add a header to the table

title

If TRUE, 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).

equation

If TRUE (by default), add a equation to the table header. The equation can also be passed in the form of a character string (LaTeX).

auto.labs

If TRUE (by default), use labels (and units) automatically from data or origdata=.

origdata

The original data set this model was fitted to. By default it is NULL and no label is used (only the name of the variables).

labs

Labels to change the names of elements in the term column of the table. By default it is NULL and nothing is changed.

lang

The natural language to use. The default value can be set with, e.g., options(data.io_lang = "fr") for French.

...

Additional arguments passed to tabularise::equation()

kind

The kind of table to produce: "tt" for tinytable, or "ft" for flextable (default).

env

The environment where to evaluate lazyeval expressions (unused for now).

Value

A flextable object that you can print in different form or rearrange with the {flextable} functions.

Examples

iris_lm <- lm(data = iris, Petal.Length ~ Sepal.Length)
tabularise::tabularise$glance(iris_lm)

Linear model

NA

R2

Adj.R2

RSE

t value

p value

Model df

Log-likelihood

AIC

BIC

Deviance

Residuals df

N

0.76

0.758

0.868

469

1.04·10-47

1

-191

387

396

111

148

150