Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Jan 29, 2024
1 parent 29a79bb commit b769aab
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
12 changes: 12 additions & 0 deletions R/group_tt.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@
#' @export
#' @inheritParams tt
#' @inheritParams style_tt
#' @param i A named list of row indices to group. The names of the list will be used as labels.
#' @param j A named list of column indices to group. The names of the list will be used as labels. See examples below..
#' @return An object of class `tt` representing the table.
#' @param indent integer number of `pt` to use when indenting the non-labelled rows.
#' @examples
#'
#' tt(mtcars[1:10, 1:5]) |>
#' group_tt(
#' i = list(
#' "Hello" = 3,
#' "World" = 8),
#' j = list(
#' "Foo" = 2:3,
#' "Bar" = 4:5))
group_tt <- function(x, i = NULL, j = NULL, indent = 1) {

if (is.null(meta(x))) stop("`x` must be generated by `tinytable::tt()`.", call. = FALSE)
Expand Down
6 changes: 3 additions & 3 deletions R/style_tt.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' Style a Tiny Table in either LaTeX or HTML format
#' Style a Tiny Table
#'
#' @details
#' This function applies styling to a table created by `tt()`. It allows customization of text style (bold, italic, monospace), text and background colors, font size, cell width, text alignment, column span, and indentation. The function supports both LaTeX (tabularray) and HTML (bootstrap) formats.
#' This function applies styling to a table created by `tt()`. It allows customization of text style (bold, italic, monospace), text and background colors, font size, cell width, text alignment, column span, and indentation. The function also supports passing native instructions to LaTeX (tabularray) and HTML (bootstrap) formats.
#'
#' Note that Markdown and Word formats are limited to these styles: italic, bold, strikeout.
#' Warning: Markdown and Word formats are limited to these styles: italic, bold, strikeout. This is because there is no markdown syntax for the other options, and because we create Word documents by converting a markdown table to .docx via the Pandoc software.
#'
#' @param x A table object created by `tt()`.
#' @param i Row indices where the styling should be applied. Can be a single value or a vector. `i=0` is the header, and negative values are higher level headers. If `colspan` is used, `i` must be of length 1.
Expand Down
15 changes: 13 additions & 2 deletions man/group_tt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/style_tt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b769aab

Please sign in to comment.