#Preparing the data and loading packages
library(modelsummary);library(tidyverse);library(gt)
as_tibble(mtcars)
df <- mtcars %>% mutate(cyl_ = factor(cyl)) %>%
dplyr::select(cyl_, mpg, vs, am, hp, wt)
#Gets table of descriptive statistics about different subsets of the data
print(t1 <- datasummary_balance(~cyl_,
data = df,
output = "gt"))
#This hides the "Std. Dev." columns
t1 %>% cols_hide(c(3,5,7))
#Now I want to hide the "Mean" column labels, but I want to keep the "cyl_" value column labels. Any ideas how?
I want something like this:
Ugly solution but one could always add cols_label(col_name = "") as a way of making every column name nothing.