Skip to contents

Convenient formatting of text components

Usage

format_algorithm(x)

format_formula(x, what = "conditional")

format_model(x)

Arguments

x

The R object that you want to report (see list of of supported objects above).

what

The name of the item returned by insight::find_formula.

Value

A character string.

A character string.

A character string.

Examples

model <- lm(Sepal.Length ~ Species, data = iris)
format_algorithm(model)
#> [1] "OLS"

if (require("lme4")) {
  model <- lme4::lmer(Sepal.Length ~ Sepal.Width + (1 | Species), data = iris)
  format_algorithm(model)
}
#> Loading required package: lme4
#> Loading required package: Matrix
#> [1] "REML and nloptwrap optimizer"
model <- lm(Sepal.Length ~ Species, data = iris)
format_formula(model)
#> [1] "formula: Sepal.Length ~ Species"

if (require("lme4")) {
  model <- lme4::lmer(Sepal.Length ~ Sepal.Width + (1 | Species), data = iris)
  format_formula(model)
  format_formula(model, "random")
}
#> [1] "formula: ~1 | Species"
model <- lm(Sepal.Length ~ Species, data = iris)
format_model(model)
#> [1] "linear model"

if (require("lme4")) {
  model <- lme4::lmer(Sepal.Length ~ Sepal.Width + (1 | Species), data = iris)
  format_model(model)
}
#> [1] "linear mixed model"