blob: deb4f3995455e581ddb020ed86a8ab16b8e3588a [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))
15kable(collapse_rows_dt, "latex", align = "c", booktabs = T) %>%
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```