Hao Zhu | 2a87e8e | 2017-06-14 15:49:33 -0400 | [diff] [blame] | 1 | --- |
| 2 | title: "Untitled" |
| 3 | output: html_document |
| 4 | --- |
| 5 | |
| 6 | ```{r} |
| 7 | library(knitr) |
| 8 | library(kableExtra) |
| 9 | collapse_rows_dt <- data.frame(C1 = c(rep("a", 10), rep("b", 5)), |
| 10 | C2 = c(rep("c", 7), rep("d", 3), rep("c", 2), rep("d", 3)), |
| 11 | C3 = 1:15, |
| 12 | C4 = sample(c(0,1), 15, replace = TRUE)) |
| 13 | kable(collapse_rows_dt, "html", align = "c") %>% |
| 14 | kable_styling() %>% |
Hao Zhu | 1111f72 | 2017-06-14 15:58:40 -0400 | [diff] [blame] | 15 | column_spec(1, bold=T) %>% |
Hao Zhu | 2a87e8e | 2017-06-14 15:49:33 -0400 | [diff] [blame] | 16 | collapse_rows(1:2) |
| 17 | ``` |