blob: b5b6db4a192fda52152e1d292a9523a9a51af562 [file] [log] [blame]
Hao Zhu62cdde52017-05-20 22:16:03 -04001% 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 Zhu49483bf2017-09-12 11:21:00 -04007group_rows(kable_input, group_label = NULL, start_row = NULL,
8 end_row = NULL, index = NULL,
Hao Zhu76f0eb62018-09-15 12:38:33 -04009 label_row_css = "border-bottom: 1px solid;",
10 latex_gap_space = "0.3em", escape = TRUE, latex_align = "l",
Hao Zhu2742ffc2018-10-17 11:23:44 -040011 colnum = NULL, bold = TRUE, italic = FALSE, hline_before = FALSE,
12 hline_after = FALSE, extra_latex_after = NULL, indent = TRUE)
Hao Zhubd95bb22017-05-22 16:08:49 -040013}
14\arguments{
Hao Zhu76281fe2017-07-03 19:33:09 -040015\item{kable_input}{Output of \code{knitr::kable()} with \code{format} specified}
Hao Zhubd95bb22017-05-22 16:08:49 -040016
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
20group starts. Note that the counting excludes header rows and other group
21labeling rows}
22
23\item{end_row}{A numeric value that tells the function in which row the group
24ends.}
25
Hao Zhu49483bf2017-09-12 11:21:00 -040026\item{index}{A named vector providing the index for robust row-grouping tasks.
27Basically, you can use it in the same way as \code{add_header_above()}.}
28
Hao Zhubd95bb22017-05-22 16:08:49 -040029\item{label_row_css}{A character string for any customized css used for the
30labeling row. By default, the labeling row will have a solid black line
31underneath. Only useful for HTML documents.}
32
33\item{latex_gap_space}{A character value telling LaTeX how large the gap
34between the previous row and the group labeling row. Only useful for LaTeX
35documents.}
Hao Zhuac7e70f2017-08-02 00:18:36 -040036
37\item{escape}{A T/F value showing whether special characters should be
38escaped.}
Hao Zhu68b5bbf2018-03-26 11:30:34 -040039
40\item{latex_align}{Adjust justification of group_label in latex only. Value should be "c" for
41centered on row, "r" for right justification, or "l" for left justification. Default
42Value is "l" If using html, the alignment can be set by using the label_row_css
43parameter.}
44
45\item{colnum}{A numeric that determines how many columns the text should span.
46The 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
53value is False.}
54
55\item{hline_after}{A replicate of \code{hline.after} in xtable. It
56addes a hline after the row}
57
58\item{extra_latex_after}{Extra LaTeX text to be added after the row.}
Hao Zhu2742ffc2018-10-17 11:23:44 -040059
60\item{indent}{A T?F value to control whether list items are indented.}
Hao Zhu62cdde52017-05-20 22:16:03 -040061}
62\description{
Hao Zhubd95bb22017-05-22 16:08:49 -040063Group a few rows in a table together under a label.
Hao Zhu62cdde52017-05-20 22:16:03 -040064}
Hao Zhu78e61222017-05-24 20:53:35 -040065\examples{
66x <- knitr::kable(head(mtcars), "html")
67# Put Row 2 to Row 5 into a Group and label it as "Group A"
68group_rows(x, "Group A", 2, 5)
69
70}