blob: a2f1138521b932acba57e0e64779fa526ba7fd2c [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") %>%
Hao Zhu38cdcdb2017-06-27 09:08:30 -100016 collapse_rows(1)
Hao Zhuf4b35292017-06-25 22:38:37 -100017```