I have a current table creating using the following code:
table1 <- ptbl %>% dplyr::select( pt_gender.factor, pt_race.factor, pt_ethnicity.factor, education.factor, employed.factor,marital.factor, home_smoker.factor,quit_support.factor,past7.factor) %>% tbl_summary( label = list(pt_gender.factor ~ "Gender", pt_race.factor ~ "Race", pt_ethnicity.factor ~ "Ethnicity", education.factor ~ "Education", employed.factor ~ "Employed", marital.factor ~ "Marital Status", home_smoker.factor ~ "Live with smoker", quit_support.factor ~ "People around are very supportive of quitting smoking", past7.factor ~ "In the past 7 days, did you smoke a cigarette (even a puff)?"))
I am trying to add two sectional titles to my table, one is "Demographics", and the other one is "Smoking Habit".
I want my table like
DemographicsGender....Race...Ethnicity......
Smoking HabitLive with smoker...People around are very supportive of quitting smoking.....
Is there a function to do it?