Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/row_spec.R |
| 3 | \name{row_spec} |
| 4 | \alias{row_spec} |
| 5 | \title{Specify the look of the selected row} |
| 6 | \usage{ |
Hao Zhu | 9410a27 | 2020-08-03 01:11:47 -0400 | [diff] [blame] | 7 | row_spec( |
| 8 | kable_input, |
| 9 | row, |
| 10 | bold = FALSE, |
| 11 | italic = FALSE, |
| 12 | monospace = FALSE, |
| 13 | underline = FALSE, |
| 14 | strikeout = FALSE, |
| 15 | color = NULL, |
| 16 | background = NULL, |
| 17 | align = NULL, |
| 18 | font_size = NULL, |
| 19 | angle = NULL, |
| 20 | extra_css = NULL, |
| 21 | hline_after = FALSE, |
| 22 | extra_latex_after = NULL |
| 23 | ) |
Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 24 | } |
| 25 | \arguments{ |
Hao Zhu | 76281fe | 2017-07-03 19:33:09 -0400 | [diff] [blame] | 26 | \item{kable_input}{Output of \code{knitr::kable()} with \code{format} specified} |
Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 27 | |
Hao Zhu | 322de08 | 2017-09-11 19:25:29 -0400 | [diff] [blame] | 28 | \item{row}{A numeric value or vector indicating which row(s) to be selected. You don't |
Hao Zhu | 2a87e8e | 2017-06-14 15:49:33 -0400 | [diff] [blame] | 29 | need to count in header rows or group labeling rows.} |
Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 30 | |
| 31 | \item{bold}{A T/F value to control whether the text of the selected row |
| 32 | need to be bolded.} |
| 33 | |
| 34 | \item{italic}{A T/F value to control whether the text of the selected row |
| 35 | need to be emphasized.} |
Hao Zhu | 3e53e60 | 2017-07-26 12:40:57 -0400 | [diff] [blame] | 36 | |
Hao Zhu | 53454f0 | 2018-01-14 16:29:10 -0500 | [diff] [blame] | 37 | \item{monospace}{A T/F value to control whether the text of the selected row |
Hao Zhu | 3e53e60 | 2017-07-26 12:40:57 -0400 | [diff] [blame] | 38 | need to be monospaced (verbatim)} |
Hao Zhu | 53e240f | 2017-09-04 20:04:29 -0400 | [diff] [blame] | 39 | |
Hao Zhu | 53454f0 | 2018-01-14 16:29:10 -0500 | [diff] [blame] | 40 | \item{underline}{A T/F value to control whether the text of the selected row |
| 41 | need to be underlined} |
| 42 | |
| 43 | \item{strikeout}{A T/F value to control whether the text of the selected row |
| 44 | need to be stricked out.} |
| 45 | |
Hao Zhu | 457acb4 | 2017-10-14 17:37:02 -0400 | [diff] [blame] | 46 | \item{color}{A character string for row text color. For example, "red" or |
| 47 | "#BBBBBB".} |
Hao Zhu | 53e240f | 2017-09-04 20:04:29 -0400 | [diff] [blame] | 48 | |
Hao Zhu | e7c8f70 | 2017-10-10 13:22:59 -0400 | [diff] [blame] | 49 | \item{background}{A character string for row background color. Here please |
Hao Zhu | 53e240f | 2017-09-04 20:04:29 -0400 | [diff] [blame] | 50 | pay attention to the differences in color codes between HTML and LaTeX.} |
Hao Zhu | e7c8f70 | 2017-10-10 13:22:59 -0400 | [diff] [blame] | 51 | |
| 52 | \item{align}{A character string for cell alignment. For HTML, possible values could |
| 53 | be \code{l}, \code{c}, \code{r} plus \code{left}, \code{center}, \code{right}, \code{justify}, \code{initial} and \code{inherit} |
| 54 | while for LaTeX, you can only choose from \code{l}, \code{c} & \code{r}.} |
| 55 | |
Hao Zhu | 8b32b19 | 2017-10-24 14:51:48 -0400 | [diff] [blame] | 56 | \item{font_size}{A numeric input for font size. For HTML, you can also use |
| 57 | options including \code{xx-small}, \code{x-small}, \code{small}, \code{medium}, \code{large}, |
| 58 | \code{x-large}, \code{xx-large}, \code{smaller}, \code{larger}, \code{initial} and \code{inherit}.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 59 | |
| 60 | \item{angle}{0-360, degree that the text will rotate.} |
Hao Zhu | b1de967 | 2018-01-08 16:29:24 -0500 | [diff] [blame] | 61 | |
| 62 | \item{extra_css}{Extra css text to be passed into the cells of the row. Note |
| 63 | that it's not for the whole row.} |
Hao Zhu | 53454f0 | 2018-01-14 16:29:10 -0500 | [diff] [blame] | 64 | |
| 65 | \item{hline_after}{T/F. A replicate of \code{hline.after} in xtable. It |
| 66 | addes a hline after ther row} |
| 67 | |
| 68 | \item{extra_latex_after}{Extra LaTeX text to be added after the row. Similar |
| 69 | with \code{add.to.row} in xtable} |
Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 70 | } |
| 71 | \description{ |
| 72 | This function allows users to select a row and then specify |
Hao Zhu | e7c8f70 | 2017-10-10 13:22:59 -0400 | [diff] [blame] | 73 | its look. It can also specify the format of the header row when \code{row} = 0. |
Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 74 | } |
| 75 | \examples{ |
Hao Zhu | 9399dcc | 2020-08-26 17:27:38 -0400 | [diff] [blame^] | 76 | \dontrun{ |
Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 77 | x <- knitr::kable(head(mtcars), "html") |
Hao Zhu | 4840bc9 | 2017-09-15 15:55:05 -0400 | [diff] [blame] | 78 | row_spec(x, 1:2, bold = TRUE, italic = TRUE) |
Hao Zhu | 9399dcc | 2020-08-26 17:27:38 -0400 | [diff] [blame^] | 79 | } |
Hao Zhu | 79f1e2a | 2017-06-11 20:55:30 -0400 | [diff] [blame] | 80 | |
| 81 | } |