Changing values in nested tibbles/lists in a markdown document

Hello everybody,
for my thesis I write a markdown document to create a .pdf output.
I have a list with nested tibbles/list in it as a result of a regression (pictures below) and would like to produce a nice looking table with gtsummary::tbl_regression %>% as_kable_extra().
Unfortunately it produces error because it can't handle the value "(intercept)" in a$table_body$variable[1] because of the brackets. So my idea was to change the value into "Intercept". For this purpose I use the following code:

reg1 <- glm(f, family = quasibinomial(),data =  ges_at,  weights = WGT3)

a <- tbl_regression(reg1, intercept = TRUE, exponentiate = TRUE) 

a$table_body$variable[1] <- "Intercept"

as_kable_extra(a, longtable = T, booktabs = T)

When I use the code outside my markdown chunks, in a regular R Skript, the change of the value to "intercept" works perfectly, but when I put it in the chunk, the change doesn't work.

Maybe anyone knows, what I could change...?
Thank you!


Can you please post a reprex with your question? If we have code we can run, we can try to assist.