| 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, | 
| Hao Zhu | 76f0eb6 | 2018-09-15 12:38:33 -0400 | [diff] [blame] | 9 |   label_row_css = "border-bottom: 1px solid;", | 
 | 10 |   latex_gap_space = "0.3em", escape = TRUE, latex_align = "l", | 
 | 11 |   colnum = NULL, bold = T, italic = F, hline_before = F, | 
 | 12 |   hline_after = F, extra_latex_after = NULL) | 
| Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 13 | } | 
 | 14 | \arguments{ | 
| Hao Zhu | 76281fe | 2017-07-03 19:33:09 -0400 | [diff] [blame] | 15 | \item{kable_input}{Output of \code{knitr::kable()} with \code{format} specified} | 
| Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 16 |  | 
 | 17 | \item{group_label}{A character string for the name of the group} | 
 | 18 |  | 
 | 19 | \item{start_row}{A numeric value that tells the function in which row the | 
 | 20 | group starts. Note that the counting excludes header rows and other group | 
 | 21 | labeling rows} | 
 | 22 |  | 
 | 23 | \item{end_row}{A numeric value that tells the function in which row the group | 
 | 24 | ends.} | 
 | 25 |  | 
| Hao Zhu | 49483bf | 2017-09-12 11:21:00 -0400 | [diff] [blame] | 26 | \item{index}{A named vector providing the index for robust row-grouping tasks. | 
 | 27 | Basically, you can use it in the same way as \code{add_header_above()}.} | 
 | 28 |  | 
| Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 29 | \item{label_row_css}{A character string for any customized css used for the | 
 | 30 | labeling row. By default, the labeling row will have a solid black line | 
 | 31 | underneath. Only useful for HTML documents.} | 
 | 32 |  | 
 | 33 | \item{latex_gap_space}{A character value telling LaTeX how large the gap | 
 | 34 | between the previous row and the group labeling row. Only useful for LaTeX | 
 | 35 | documents.} | 
| Hao Zhu | ac7e70f | 2017-08-02 00:18:36 -0400 | [diff] [blame] | 36 |  | 
 | 37 | \item{escape}{A T/F value showing whether special characters should be | 
 | 38 | escaped.} | 
| Hao Zhu | 68b5bbf | 2018-03-26 11:30:34 -0400 | [diff] [blame] | 39 |  | 
 | 40 | \item{latex_align}{Adjust justification of group_label in latex only. Value should be "c" for | 
 | 41 | centered on row, "r" for right justification, or "l" for left justification. Default | 
 | 42 | Value is "l"  If using html, the alignment can be set by using the label_row_css | 
 | 43 | parameter.} | 
 | 44 |  | 
 | 45 | \item{colnum}{A numeric that determines how many columns the text should span. | 
 | 46 | The default setting will have the text span the entire length.} | 
 | 47 |  | 
 | 48 | \item{bold}{A T/F value to control whether the text should be bolded.} | 
 | 49 |  | 
 | 50 | \item{italic}{A T/F value to control whether the text should to be emphasized.} | 
 | 51 |  | 
 | 52 | \item{hline_before}{A T/F value that addes a horizontal line before the group_row label.  Default | 
 | 53 | value is False.} | 
 | 54 |  | 
 | 55 | \item{hline_after}{A replicate of \code{hline.after} in xtable. It | 
 | 56 | addes a hline after the row} | 
 | 57 |  | 
 | 58 | \item{extra_latex_after}{Extra LaTeX text to be added after the row.} | 
| Hao Zhu | 62cdde5 | 2017-05-20 22:16:03 -0400 | [diff] [blame] | 59 | } | 
 | 60 | \description{ | 
| Hao Zhu | bd95bb2 | 2017-05-22 16:08:49 -0400 | [diff] [blame] | 61 | Group a few rows in a table together under a label. | 
| Hao Zhu | 62cdde5 | 2017-05-20 22:16:03 -0400 | [diff] [blame] | 62 | } | 
| Hao Zhu | 78e6122 | 2017-05-24 20:53:35 -0400 | [diff] [blame] | 63 | \examples{ | 
 | 64 | x <- knitr::kable(head(mtcars), "html") | 
 | 65 | # Put Row 2 to Row 5 into a Group and label it as "Group A" | 
 | 66 | group_rows(x, "Group A", 2, 5) | 
 | 67 |  | 
 | 68 | } |