blob: 795bbe17e72b085f89bde211ade14150b04712db [file] [log] [blame]
Hao Zhuf4b35292017-06-25 22:38:37 -10001---
2title: "Untitled"
3output: pdf_document
4---
5
6```{r}
7library(knitr)
8library(kableExtra)
9collapse_rows_dt <- data.frame(C1 = c(rep("aaaaaa aaaaaa", 10), rep("bbbbb bbbbbb", 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))
13kable(collapse_rows_dt, "latex", align = "c", booktabs = T) %>%
14 kable_styling() %>%
15 column_spec(1, bold=T, width = "2em") %>%
16 collapse_rows(1:2)
17```