我的RMarkdown文档具有代码块,这些代码块可从一个块中生成多个图形或表格。例如,它遍历一堆变量以为每个变量生成摘要统计表。问题在于,当我尝试生成HTML文档时,这些数字/表格的编号通常是错误的;编译PDF时不会发生此问题。问题在于,从同一块生成的所有表都将获得相同的表号。
这里是一个例子:
---
title: "Testing Section Numbers"
author: "Authors"
date: "January 2019"
output:
bookdown::gitbook:
number_sections: yes
editor_options:
chunk_output_type: console
---
# R Markdown
Text text text
```{r pressure1, echo=FALSE, fig.cap=c("This is my plot", "This is my other plot")}
plot(pressure)
plot(iris)
```
```{r pressure2, echo=FALSE}
library(knitr)
kable(pressure, caption = "My first table")
kable(pressure, caption = "My second table")
```
答案 0 :(得分:1)
这是由于 knitr 的错误所致,该错误在Github的I just fixed中development version。请尝试
onPaymentMethodNonceCreated