blob: 0059e6f67b8de0c9604f166130aaa0e158cf72ca [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}
Hao Zhu72917f92019-03-15 18:41:42 -04005\alias{pack_rows}
Hao Zhu62cdde52017-05-20 22:16:03 -04006\title{Put a few rows of a table into one category}
7\usage{
Hao Zhu9410a272020-08-03 01:11:47 -04008group_rows(
9 kable_input,
10 group_label = NULL,
11 start_row = NULL,
12 end_row = NULL,
13 index = NULL,
Hao Zhu76f0eb62018-09-15 12:38:33 -040014 label_row_css = "border-bottom: 1px solid;",
Hao Zhu9410a272020-08-03 01:11:47 -040015 latex_gap_space = "0.3em",
16 escape = TRUE,
17 latex_align = "l",
18 latex_wrap_text = FALSE,
19 colnum = NULL,
20 bold = TRUE,
21 italic = FALSE,
22 hline_before = FALSE,
23 hline_after = FALSE,
24 extra_latex_after = NULL,
25 indent = TRUE
26)
Hao Zhu72917f92019-03-15 18:41:42 -040027
Hao Zhu9410a272020-08-03 01:11:47 -040028pack_rows(
29 kable_input,
30 group_label = NULL,
31 start_row = NULL,
32 end_row = NULL,
33 index = NULL,
Hao Zhu72917f92019-03-15 18:41:42 -040034 label_row_css = "border-bottom: 1px solid;",
Hao Zhu9410a272020-08-03 01:11:47 -040035 latex_gap_space = "0.3em",
36 escape = TRUE,
37 latex_align = "l",
38 latex_wrap_text = FALSE,
39 colnum = NULL,
40 bold = TRUE,
41 italic = FALSE,
42 hline_before = FALSE,
43 hline_after = FALSE,
44 extra_latex_after = NULL,
45 indent = TRUE
46)
Hao Zhubd95bb22017-05-22 16:08:49 -040047}
48\arguments{
Hao Zhu76281fe2017-07-03 19:33:09 -040049\item{kable_input}{Output of \code{knitr::kable()} with \code{format} specified}
Hao Zhubd95bb22017-05-22 16:08:49 -040050
51\item{group_label}{A character string for the name of the group}
52
53\item{start_row}{A numeric value that tells the function in which row the
54group starts. Note that the counting excludes header rows and other group
55labeling rows}
56
57\item{end_row}{A numeric value that tells the function in which row the group
58ends.}
59
Hao Zhu49483bf2017-09-12 11:21:00 -040060\item{index}{A named vector providing the index for robust row-grouping tasks.
61Basically, you can use it in the same way as \code{add_header_above()}.}
62
Hao Zhubd95bb22017-05-22 16:08:49 -040063\item{label_row_css}{A character string for any customized css used for the
64labeling row. By default, the labeling row will have a solid black line
65underneath. Only useful for HTML documents.}
66
67\item{latex_gap_space}{A character value telling LaTeX how large the gap
68between the previous row and the group labeling row. Only useful for LaTeX
69documents.}
Hao Zhuac7e70f2017-08-02 00:18:36 -040070
71\item{escape}{A T/F value showing whether special characters should be
72escaped.}
Hao Zhu68b5bbf2018-03-26 11:30:34 -040073
74\item{latex_align}{Adjust justification of group_label in latex only. Value should be "c" for
75centered on row, "r" for right justification, or "l" for left justification. Default
76Value is "l" If using html, the alignment can be set by using the label_row_css
77parameter.}
78
Hao Zhu9410a272020-08-03 01:11:47 -040079\item{latex_wrap_text}{T/F for wrapping long text. Default is off. Whenever
80it is turned on, the table will take up the entire line. It's recommended
81to use this with full_width in kable_styling.}
82
Hao Zhu68b5bbf2018-03-26 11:30:34 -040083\item{colnum}{A numeric that determines how many columns the text should span.
84The default setting will have the text span the entire length.}
85
86\item{bold}{A T/F value to control whether the text should be bolded.}
87
88\item{italic}{A T/F value to control whether the text should to be emphasized.}
89
90\item{hline_before}{A T/F value that addes a horizontal line before the group_row label. Default
91value is False.}
92
93\item{hline_after}{A replicate of \code{hline.after} in xtable. It
94addes a hline after the row}
95
96\item{extra_latex_after}{Extra LaTeX text to be added after the row.}
Hao Zhu2742ffc2018-10-17 11:23:44 -040097
Hao Zhu2b739ac2020-08-15 01:38:51 -040098\item{indent}{A T/F value to control whether list items are indented.}
Hao Zhu62cdde52017-05-20 22:16:03 -040099}
100\description{
Hao Zhubd95bb22017-05-22 16:08:49 -0400101Group a few rows in a table together under a label.
Hao Zhu62cdde52017-05-20 22:16:03 -0400102}
Hao Zhu78e61222017-05-24 20:53:35 -0400103\examples{
104x <- knitr::kable(head(mtcars), "html")
105# Put Row 2 to Row 5 into a Group and label it as "Group A"
Hao Zhu72917f92019-03-15 18:41:42 -0400106pack_rows(x, "Group A", 2, 5)
Hao Zhu78e61222017-05-24 20:53:35 -0400107
108}