我希望从包含带有超链接的分页表的 R Notebook 中编织一个 html 文件。
可以使用 插入超链接knitr::kable
,但我找不到使用此功能生成分页表的方法。
分页表是默认的笔记本输出,但我找不到插入功能超链接的方法。非常感谢您的帮助。
---
title: "Paged notebook table with hyperlinks"
output:
html_notebook:
code_folding: "hide"
---
```{r rows.print=3}
wiki.url <- "https://en.wikipedia.org/wiki/"
df1 <- data.frame(Month=month.name, URL=paste0("[", month.name, "](", wiki.url, month.name, ")"))
df2 <- data.frame(Month=month.name, URL=paste0("<a href='", wiki.url, month.name, "'>", month.name, "</a>"))
print(df1)
```
```{r rows.print=3}
print(df2)
```
```{r rows.print=3}
knitr::kable(df1)
```
```{r rows.print=3}
knitr::kable(df2)
```