A convenience function which can be passed to the coef_rename
argument of
the modelsummary
function.
coef_rename(
x,
factor = TRUE,
factor_name = TRUE,
backticks = TRUE,
titlecase = TRUE,
underscore = TRUE,
asis = TRUE
)
character vector of term names to transform
boolean remove the "factor()" label
boolean remove the "factor()" label and the name of the variable
boolean remove backticks
boolean convert to title case
boolean replace underscores by spaces
boolean remove the I
from as-is formula calls
library(modelsummary)
dat <- mtcars
dat$horse_power <- dat$hp
mod <- lm(mpg ~ horse_power + factor(cyl), dat)
modelsummary(mod, coef_rename = coef_rename)