The group_rows () function in the kableExtra package does not group rows
I am trying to dump a table into rmarkdown using knitr kable()
as part of the package. Below is one table that shows what I am trying to output with an inline dataset. The other is a subset of my dataset. When using my dataset, the output doesn't line up and the code is basically the same. I feel like I've lost something basic? Please let me know! My code is below and the snapshot is below.
```{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)
```
source to share
Thank you for message!
This error was caused by an incorrect backtrack before special embedded characters. It has been fixed in the current github release. Use devtools::install_github("haozhu233/kableExtra")
and install the latest version. Or you can wait for the CRAN version to be released in about 2 weeks.
source to share