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