R/tabularise.nls.R
tabularise_coef.nls.Rd
This method extracts and formats the coefficients from an nls object,
similar to stats::coef()
, but in flextable object.
# S3 method for class 'nls'
tabularise_coef(
data,
header = TRUE,
title = header,
equation = header,
auto.labs = TRUE,
origdata = NULL,
labs = NULL,
lang = getOption("SciViews_lang", "en"),
footer = TRUE,
...,
kind = "ft"
)
An nls object.
If TRUE
(by default), add a title to the table.
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).
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).
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 (only the name of the variables).
Labels to change the names of elements in the term
column of
the table. By default it is NULL
and nothing is changed.
The language to use. The default value can be set with, e.g.,
options(SciViews_lang = "fr")
for French.
If TRUE
(by default, it is TRUE), add a footer to the table.
Not used
The kind of table to produce: "tt" for tinytable, or "ft" for flextable (default).
A flextable object that you can print in different forms or rearrange with the {flextable} functions.
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$coef(chick1_logis)
Nonlinear least squares logistic model
Asym
xmid
scal
937
35.2
11.4
Residual sum-of-squares: 76.66
Number of iterations to convergence: 0
Achieved convergence tolerance: 7.343e-06