Sle R.
Sle R.

Reputation: 119

kableExtra : add a footnote to a rowname [kableExtra, Rmd]

I'm using the kableExtra library with R Markdown, I would like to add footnotes to the row labels (and secondary, to other cells). How can I do that ?

Data example below:

library(kableExtra)
tab = data.frame(matrix(NA, 5,5))
rownames(tab) = paste("info", 1:5)
kable(tab)

I want to add a footnote to info 1, the label of the 1st line (for example).

Any ideas?

Thanks in advance

Upvotes: 3

Views: 356

Answers (1)

Flora Grappelli
Flora Grappelli

Reputation: 679

You can use footnotefrom kableExtra:

dt <- mtcars[1:5, 1:5]
footnote(knitr::kable(dt, "html"), alphabet = c("Note a", "Note b"))

Upvotes: 1

Related Questions