blob: 25dc0b982d191ae9bb1778c0109324e7e0f73b1b [file] [log] [blame]
Hao Zhuf4b35292017-06-25 22:38:37 -10001---
2title: "Untitled"
Hao Zhu654c91f2017-07-03 14:03:34 -04003output:
4 pdf_document:
5 keep_tex: true
Hao Zhuf4b35292017-06-25 22:38:37 -10006---
7
8```{r}
9library(knitr)
10library(kableExtra)
11collapse_rows_dt <- data.frame(C1 = c(rep("aaaaaa aaaaaa", 10), rep("bbbbb bbbbbb", 5)),
Hao Zhu654c91f2017-07-03 14:03:34 -040012 C2 = c(rep("c", 7), rep("d", 4), rep("c", 2), rep("d", 2)),
Hao Zhuf4b35292017-06-25 22:38:37 -100013 C3 = 1:15,
14 C4 = sample(c(0,1), 15, replace = TRUE))
Hao Zhu8060c752017-07-03 18:19:35 -040015kable(collapse_rows_dt, "latex", align = "c") %>%
Hao Zhu654c91f2017-07-03 14:03:34 -040016 column_spec(1, bold = T, width = "5em") %>%
17 collapse_rows(1:2)
Hao Zhuf4b35292017-06-25 22:38:37 -100018```