Currently kableExtra 0.5.1
only supports Put a few rows of a table into one category. I wonder if there is any tweak to Put a few rows of a table into many categories programmatically like group_rows(kable_input = x, group_label = c("Group 1", "Group 2"), start_row = c(1, 5), end_row = c(2, 6))
. Thanks
library(knitr)
library(kableExtra)
x <- knitr::kable(head(mtcars, 10), "latex")
kableExtra::group_rows(kable_input = x, group_label = c("Group 1", "Group 2"), start_row = c(1, 5), end_row = c(2, 6))
With dev version of
kableExtra
, you can use theindex
option to group rows in a similar way withadd_header_above()
.