Hao Zhu | 2a87e8e | 2017-06-14 15:49:33 -0400 | [diff] [blame] | 1 | --- |
| 2 | title: "Untitled" |
| 3 | output: html_document |
| 4 | --- |
| 5 | |
| 6 | ```{r} |
| 7 | library(knitr) |
| 8 | library(kableExtra) |
Hao Zhu | 3166f06 | 2017-06-26 07:51:46 -1000 | [diff] [blame] | 9 | set.seed(100) |
Hao Zhu | 2a87e8e | 2017-06-14 15:49:33 -0400 | [diff] [blame] | 10 | collapse_rows_dt <- data.frame(C1 = c(rep("a", 10), rep("b", 5)), |
Hao Zhu | 654c91f | 2017-07-03 14:03:34 -0400 | [diff] [blame] | 11 | C2 = c(rep("c", 7), rep("d", 4), rep("c", 2), rep("d", 2)), |
Hao Zhu | 2a87e8e | 2017-06-14 15:49:33 -0400 | [diff] [blame] | 12 | C3 = 1:15, |
| 13 | C4 = sample(c(0,1), 15, replace = TRUE)) |
| 14 | kable(collapse_rows_dt, "html", align = "c") %>% |
| 15 | kable_styling() %>% |
Hao Zhu | 1111f72 | 2017-06-14 15:58:40 -0400 | [diff] [blame] | 16 | column_spec(1, bold=T) %>% |
Hao Zhu | 38cdcdb | 2017-06-27 09:08:30 -1000 | [diff] [blame] | 17 | collapse_rows() |
Hao Zhu | 2a87e8e | 2017-06-14 15:49:33 -0400 | [diff] [blame] | 18 | ``` |