blob: 3f50879a37685318cd45bdb796bb808437e12b6b [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 Zhu38cdcdb2017-06-27 09:08:30 -100017 collapse_rows()
Hao Zhu2a87e8e2017-06-14 15:49:33 -040018```