why collapse row from kableExtra package not working

Viewed 1054

I want to collapse rows which are duplicated as in the example

collapse_rows_dt <- data.frame(C1 = c(rep("a", 10), rep("b", 5)),
                 C2 = c(rep("c", 7), rep("d", 3), rep("c", 2), rep("d", 3)),
                 C3 = 1:15,
                 C4 = sample(c(0,1), 15, replace = TRUE))
kbl(collapse_rows_dt, align = "c") %>%
  kable_paper(full_width = F) %>%
  column_spec(1, bold = T) %>%
  collapse_rows(columns = 1:2, valign = "top")

I am getting the dataframe without any change as output enter image description here

Any idea how to fix it ? Is there any alternative way to collapse rows based on a column which has duplicated values ?

The desired output: enter image description here

1 Answers

Had the same issue, updating rvest package solved it for me

Related