'Formating tbl_svysummary() outputs in R

I'm doing descriptive analysis of survey data, I'm using the gtsummary package which have been working nicely.

I use this code, I don't provide any data because I'm sure I just need to add something to the arguments,

twbysexo_a<-estrato_a %>% tbl_svysummary(by= PB1,
                                         include = c(teletrab_3, PB1), 
                                         percent = "column", 
                                         missing = "no", 
                                         digits = ~2)%>%
    add_overall(last = T, col_label = "**Total**, N={N}")%>%
    modify_header(label = "Variable")

twbysexo_a

The output I get can be seen below.

Printed output

What I want is the output to exclude the row with the "teletrab_3" label, so it would look neater. By doing some cut of the image I would like it to look like this:

enter image description here

EDIT: As Daniel commented adding the option remove_row_type() to the pipe made it work just fine:

twbysexo_a<-estrato_a %>% tbl_svysummary(by= PB1,
                                         include = c(teletrab_3, PB1), 
                                         percent = "column", 
                                         missing = "no", 
                                         digits = ~2)%>%
    add_overall(last = T, col_label = "**Total**, N={N}")%>%
    modify_header(label = "Variable")%>%
    remove_row_type(teletrab_3, type = "header")

twbysexo_a

And this is the output:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source