I wonder is it possible to remove model names entirely (and delete the row in the table). I tried setting them to NULL but that does not seem to work.
library(modelsummary)
x<-rnorm(5)
y<-rnorm(5)
models<-list(lm(y~x),lm(y~x))
names(models)<-NULL
#This still produces models with names
modelsummary(models)
CodePudding user response:
An option may be to set the names to blank (""
)
names(models) <- rep("", length(models))
modelsummary(models)
-output
Deleting row - if it is coefficient, use `coef_omit
modelsummary(models, coef_omit = "x")
and if there are other parameters to be removed, can also use a regex in gof_omit
modelsummary(models, gof_omit = "AIC|BIC")
CodePudding user response:
In the development version of modelsummary
(version >0.9.4), all the extra arguments that you pass to modelsummary
will be pushed through the ellipsis (...
) automatically to kableExtra::kbl()
. This means that you can use the col.names=NULL
argument to get this:
library(remotes)
install_github("vincentarelbundock/modelsummary")
library(modelsummary)
mod <- list(
lm(mpg ~ hp, mtcars),
lm(mpg ~ hp drat, mtcars)
)
modelsummary(mod, col.names = NULL)