r - 添加表格标题编号 R-Markdown
问题描述
我无法理解如何将图形标题编号表添加到 R-Markdown 中的表中。我正在使用bookdown
并且一直在尝试理解文档的2.5 表部分。
它说,当您向函数添加标题时,kable
它将自动标记为编号。但是,我只得到标签的“文本”部分而没有数字。
---
title: "test"
author: "x"
date: "February 20, 2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
```{r libraries, echo=FALSE}
library(tidyverse, warn.conflicts = T)
library(kableExtra)
library(bookdown)
```
```{r example, echo=T}
head(pressure) %>%
kable(caption = "Pressure",
booktabs = T) %>%
kable_styling(full_width = F)
```
非常感谢您帮助理解如何做到这一点。
解决方案
您没有使用bookdown
但rmarkdown::html_document()
由于output
标题。您需要将标题更改为
---
title: "test"
author: "x"
date: "February 20, 2019"
output: bookdown::html_document2
---
为了bookdown
在单个文件项目中使用功能。对于实际书籍,最好让bookdown
包为您设置骨架,例如通过 RStudio 插件。
推荐阅读
- javascript - 在 React 中调用 set state 时如何从数组中获取更新的 ID
- javascript - 如何在 jquery-confirm js 中使用图像
- javascript - 使用eventListener单击某个元素后如何获取返回值?
- swift - 无法运行 sonarqube 中的最后一个脚本 (./run-sonar-swift.sh -v)
- java - 应用程序更新 firebase 实时数据库中的数据,但在 recyclerview 中不显示任何内容
- docker - 如何设置 Squid 以绕过 localnet 上客户端的基本身份验证?
- webauthn - 为什么网络钓鱼网站会要求用户通过 webauthn,而不是直接要求用户名/密码?
- c# - System.ArgumentNullException:值不能为空。参数名称:userManager
- javascript - 如何使用 RedirectToAction 传递 viewbag
- python - 基于列值dataframa pandas python创建值