gtsummary footnote marks as subscript instead of superscript

162 views Asked by At

The footnotes in gtsummary are indexed as superscript:

tbl_summary example

But to my knowledge, the convention in almost every research field is to use subscript. This has been -- quite understandably-- a point of confusion when presenting my tables to lay audiences. They ask me "why is your p-value squared?"

This is reproducible if you run %>% tbl_summary() %>% add_p() on any dataframe. The footnotes will be indexed as superscripts instead of subscripts.

There does not seem to be any way to change it using modify_footnote.

Is there any possible way to move it? I would like my footnote indices to look like this:

footnotes at bottom

without having to tweak them manually after rendering.

1

There are 1 answers

3
Daniel D. Sjoberg On

You can use the gt::opt_footnote_marks() function to change the default footnote mark. See example below!

library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.7.2'

tbl <- trial %>% 
  select(trt, age, response) %>%
  tbl_summary(by = trt, missing = "no") %>%
  add_p() %>%
  separate_p_footnotes() %>%
  as_gt() %>%
  gt::opt_footnote_marks(marks = "letters")

enter image description here Created on 2023-08-22 with reprex v2.0.2