blob: 9ca589e74d7bafc27616347dfef6e3f4a6572c22 [file] [log] [blame]
Hao Zhu2a87e8e2017-06-14 15:49:33 -04001---
2title: "Untitled"
3output: html_document
4---
5
6```{r}
7library(knitr)
8library(kableExtra)
Hao Zhu3166f062017-06-26 07:51:46 -10009set.seed(100)
Hao Zhu2a87e8e2017-06-14 15:49:33 -040010collapse_rows_dt <- data.frame(C1 = c(rep("a", 10), rep("b", 5)),
11 C2 = c(rep("c", 7), rep("d", 3), rep("c", 2), rep("d", 3)),
12 C3 = 1:15,
13 C4 = sample(c(0,1), 15, replace = TRUE))
14kable(collapse_rows_dt, "html", align = "c") %>%
15 kable_styling() %>%
Hao Zhu1111f722017-06-14 15:58:40 -040016 column_spec(1, bold=T) %>%
Hao Zhu2a87e8e2017-06-14 15:49:33 -040017 collapse_rows(1:2)
18```