ddsjoberg / gtsummary

Presentation-Ready Data Summary and Analytic Result Tables
http://www.danieldsjoberg.com/gtsummary
Other
1.05k stars 124 forks source link

v2.0 `modify_footnote()` updates #1675

Open ddsjoberg opened 5 months ago

ddsjoberg commented 5 months ago
ddsjoberg commented 5 months ago

I wonder if it'd be best to create a new function modify_footer() and modify_abbrevation() that would

It would be better to keep modify_footnote() but change the API in a hopefully non-breaking way.

modify_footnote(
   x, 
  ..., 
  location = c("header", "body", "spanner", "title", "subtitle"),  # would need to specify one of these,
  rows = NULL, # only used when location='body'
  spanner_level = 1L, # only used when location='spanner'
  replace = TRUE,  # the current implementation only allows one footnote per cell, so it allows replaces the existing
  text_interpret = c("md", "html")
)

We can keep the same syntax for deleting footnotes, e.g. colname = NA


Maybe it would be easier to simply export footnote functions for each location:

modify_footnote_header()
modify_footnote_body()
modify_footnote_spanner()
modify_footnote_title() # this would depend on whether we go for titles or captions (i don't think we can add footnotes to captions?)
modify_footnote_subtitle()