Skip to contents
loading...

Extract the information contained in an nls object in a table as it could be obtained by broom::glance(). Here, the table is nicely formatted as an (almost) publication-ready form (good for informal reports, notebooks, etc).

Usage

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

Arguments

data

An nls object.

header

If TRUE (by default), add a title 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

Add equation of the model to the table. If TRUE, equation() is used. The equation can also be passed in the form of a character string (LaTeX).

lang

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

...

Additional arguments passed to 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 forms or rearrange with the {flextable} functions.

Examples

data("ChickWeight", package = "datasets")
chick1 <- ChickWeight[ChickWeight$Chick == 1, ]

# Adjust a logistic curve
chick1_logis <- nls(data = chick1, weight ~ SSlogis(Time, Asym, xmid, scal))

tabularise::tabularise$glance(chick1_logis)

Nonlinear least squares logistic model

NA

Relative standard error

Convergence tolerance

Log-Likelihood

AIC

BIC

Deviance

df

N

2.92

7.34·10-06

-28.2

64.3

66.2

76.7

9

12

tabularise::tabularise$glance(chick1_logis, lang = "fr")

Modèle non linéaire logistique

NA

Ecart type des résidus

Tolérance de convergence

Log-vraisemblance

AIC

BIC

Déviance

Ddl

N

2.92

7.34·10-06

-28.2

64.3

66.2

76.7

9

12