简体   繁体   中英

group_rows() function in kableExtra package not grouping rows

I am trying to output a table in rmarkdown using the kable() as a part of the knitr package. Below is one table that shows what I am trying to output with a built in data set. The other is a subset of my data set. When using my data set the output is not lining up and the code is basically the same. I feel like I a missing something basic? Please let me know! My code is below, and a picture of the output is below that.

```{r, results="asis"}
Table = kable(mtcars[1:10, 1:6], caption = "GOOD TABLE", booktabs = T, format="latex")
Table = kable_styling(Table) 
Table = group_rows(Table, "Group 1", 2, 4) 
group_rows(Table, "Group 2", 5, 6)
```

```{r, results="asis"}
Table = data.frame(MYDATA)
Table = kable(Table, caption = "BAD TABLE", booktabs = T, format="latex")
Table = kable_styling(Table) 
Table = group_rows(Table, "Group 1", 2, 4) 
group_rows(Table, "Group 2", 5, 6)
```

输出结果

Thanks for reporting!

This bug was produced by a mishandling of backslash in front of special inline symbols. It has been fixed in the current github version. Please use devtools::install_github("haozhu233/kableExtra") and install the latest version. Or you can wait for the CRAN version which will be release in about 2 weeks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM