我在bookdown文档中有以下R代码块:
```{r list-organisms, include = TRUE, echo = FALSE, as.is = TRUE}
data %>%
dplyr::select(biological_source_name) %>%
唯一() %>%
dplyr::rename(“生物来源”= biological_source_name) %>%
kable(caption=“基准测试中使用的源微生物基因组列表。”,booktabs = TRUE)
在文档中,我使用了交叉引用,例如:
listed in Table \@ref(tab:list-organisms).
然而,这些都没有被找到,我在整个文档中都使用了??
。生成的html如下所示:
<table>
<thead>
<tr class="header">
<th align="left">Biological Source</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">T. composti</td>
</tr>
...
表格标题也没有出现。
发布于 2017-10-26 02:07:22
我解决了这个问题。在bookdown中,当表只包含一列时,knitr::kable
文档不能正确输出。向表中添加其他列将生成图例并修复交叉引用。
https://stackoverflow.com/questions/46840323
复制相似问题