[英]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).我正在使用带有 R Markdown 的
kableExtra
库,我想在行标签中添加脚注(以及在其他单元格中添加脚注)。 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).我想在
info 1
中添加一个脚注,即第一行的 label(例如)。
Any ideas?有任何想法吗?
Thanks in advance提前致谢
You can use footnote
from kableExtra
:您可以使用
kableExtra
的footnote
:
dt <- mtcars[1:5, 1:5]
footnote(knitr::kable(dt, "html"), alphabet = c("Note a", "Note b"))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.