3

I want to change the footnote marks in my gt table so that in the wt column, I do not have the number 2 but an asterisk (*).

I want to keep footnote mark 1.

  library(gt)
  
  # Create a sample gt table with custom footnote marks
  my_table <- gt(
    head(mtcars, 10))

  my_table %>% 
    tab_footnote(
      footnote = "Sequenced twice.",
      locations = cells_body(columns=disp, rows=c(1,2))
    ) %>% 
    tab_footnote(
      footnote = "Change mark",
      locations = cells_body(columns=wt, rows=c(4,5))
    )

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
LDT
  • 2,856
  • 2
  • 15
  • 32

1 Answers1

2

We may use opt_footnote_marks

library(gt)
my_table %>%
  tab_footnote(
    footnote = "Sequenced twice.",
    locations = cells_body(columns=disp, rows=c(1,2))
  ) %>%
  tab_footnote(
    footnote = "Change mark",
    locations = cells_body(columns=wt, rows=c(4,5))
  ) %>%
  opt_footnote_marks(    
    marks     = c("1", "*")) 

-output

enter image description here

akrun
  • 874,273
  • 37
  • 540
  • 662