我正在尝试在我的 R-markdown 报告中放置一个表格,我喜欢它生成的表格,但报告中显示了 laTeX 代码。我究竟做错了什么?请参阅图片和代码以供参考。我对 LaTeX 和降价非常陌生,真的不知道我在做什么哈哈。出于安全原因,图像中的数据被涂黑。谢谢!
---
title: "Deal Fees by Client Ownership 2008-2018"
output:
pdf_document: default
html_document: default
word_document: default
header-includes:
- \usepackage{booktabs}
- \usepackage{caption}
---
```{r, echo = FALSE, message = FALSE}
library(knitr)
library(scales)
library(ggplot2)
library(lubridate)
library(dplyr)
library(reshape2)
library(xtable)
library(kableExtra)
```
```{r, echo = FALSE, message = FALSE, comment=NA, results = 'asis'}
kable(df, format = "latex", caption = "Fee variances ($ millions)", booktabs = T) %>%
kable_styling() %>%
group_rows("Average", 1, 4) %>%
group_rows("Median", 5, 8)
```