Home > database >  is it possible to hide the footnote number reference in flextable footer section and replace with ow
is it possible to hide the footnote number reference in flextable footer section and replace with ow

Time:01-13

I have a flextable:

df = data.frame(col1 = c(123,234,54,5), col2 = c(NA,1,2,3), col3 = 5:8)
df %>%
  flextable() %>%
  footnote(i = 1, j = 1,
           value = as_paragraph('this is a footnote'),
           ref_symbols = "1",
           part = "body") %>%
  footnote(i = 1, j = 1,
           value = as_paragraph(as_b("Note (2):"),"This is another foonote"),
           ref_symbols = "2",
           part = "body") 

that shows

enter image description here

What I would like to do is keep the flextable and footnotes, but remove the little 1 and 2 that appear in the footer section.

CodePudding user response:

The David Gohel's previous answer is fine for not getting this behavior of adding the symbol in the cell and in the footnote, but this previous answer will not add "1" or "2" in the cells of the table. In this case, you have to add these symbols by yourself in the cells, since the footnote func' require a "value" parameter (or you get Error in mapply(function(x, y) { : argument "value" is missing, with no default).

In order to add ¹, ², etc. in the cells of the table, I suggest to use a superscript generator (e.g., here), and a paste0 func' to modify the cells and add the symbol ¹ to the data; then use the add_footer_lines func' to create the footnote that you want, without the symbol at the beginning of the footnote (see David Gohel's previous answer).

PS: for a good readability of the "ref_symbols", I prefer to use letters when the symbol appears next to a number (e.g., I use "† ", "‡ ", "A" or "B") and I add number-footnote-symbol when it come next to a text (e.g., ¹ or ²).

CodePudding user response:

library(flextable)
df <- data.frame(col1 = c(123,234,54,5), col2 = c(NA,1,2,3), col3 = 5:8)
df |>
  flextable() |>
  add_footer_lines(as_paragraph(as_b("Note (2):"),"This is another foonote"))
  • Related