Hao Zhu | 62cdde5 | 2017-05-20 22:16:03 -0400 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/group_rows.R |
| 3 | \name{group_rows} |
| 4 | \alias{group_rows} |
| 5 | \title{Put a few rows of a table into one category} |
| 6 | \usage{ |
Hao Zhu | 49483bf | 2017-09-12 11:21:00 -0400 | [diff] [blame^] | 7 | group_rows(kable_input, group_label = NULL, start_row = NULL, |
| 8 | end_row = NULL, index = NULL, |
| 9 | label_row_css = "border-bottom: 1px solid;", latex_gap_space = "0.3em", |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 10 | escape = TRUE) |
Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 11 | } |
| 12 | \arguments{ |
Hao Zhu | 76281fe | 2017-07-03 19:33:09 -0400 | [diff] [blame] | 13 | \item{kable_input}{Output of \code{knitr::kable()} with \code{format} specified} |
Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 14 | |
| 15 | \item{group_label}{A character string for the name of the group} |
| 16 | |
| 17 | \item{start_row}{A numeric value that tells the function in which row the |
| 18 | group starts. Note that the counting excludes header rows and other group |
| 19 | labeling rows} |
| 20 | |
| 21 | \item{end_row}{A numeric value that tells the function in which row the group |
| 22 | ends.} |
| 23 | |
Hao Zhu | 49483bf | 2017-09-12 11:21:00 -0400 | [diff] [blame^] | 24 | \item{index}{A named vector providing the index for robust row-grouping tasks. |
| 25 | Basically, you can use it in the same way as \code{add_header_above()}.} |
| 26 | |
Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 27 | \item{label_row_css}{A character string for any customized css used for the |
| 28 | labeling row. By default, the labeling row will have a solid black line |
| 29 | underneath. Only useful for HTML documents.} |
| 30 | |
| 31 | \item{latex_gap_space}{A character value telling LaTeX how large the gap |
| 32 | between the previous row and the group labeling row. Only useful for LaTeX |
| 33 | documents.} |
Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 34 | |
| 35 | \item{escape}{A T/F value showing whether special characters should be |
| 36 | escaped.} |
Hao Zhu | 62cdde5 | 2017-05-20 22:16:03 -0400 | [diff] [blame] | 37 | } |
| 38 | \description{ |
Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 39 | Group a few rows in a table together under a label. |
Hao Zhu | 62cdde5 | 2017-05-20 22:16:03 -0400 | [diff] [blame] | 40 | } |
Hao Zhu | 78e6122 | 2017-05-24 20:53:35 -0400 | [diff] [blame] | 41 | \examples{ |
| 42 | x <- knitr::kable(head(mtcars), "html") |
| 43 | # Put Row 2 to Row 5 into a Group and label it as "Group A" |
| 44 | group_rows(x, "Group A", 2, 5) |
| 45 | |
| 46 | } |