I would like to quickly change the column labels in a gt table of several models. Is there an easier way than providing a named vector? It would be nice to just provide a vector of names.
data('mtcars')
str(mtcars)
mod1<-lm(mpg~wt, data=mtcars)
mod2<-lm(hp~wt, data=mtcars)
#install.packages('modelsummary')
library(modelsummary)
mods<-modelsummary(list(mod1, mod2), output="gt")
#install.packages('gt')
library(gt)
#install.packages('tidyverse')
library(tidyverse)
mods %>%
cols_label("Model 1" = 'mpg', "Model 2"='hp')