tableRow: Functions to work with rows in tables

View source: R/tableRow.R

find_tableRowR Documentation

Functions to work with rows in tables

Description

Functions to work with rows in tables

Usage

find_tableRow(table, row)

tableRow(table, row)

tableRow(table, row, asis = FALSE) <- value

Arguments

table

A tabular-like environment to work with.

row

row in the table (1 is top row), including rows of labels.

asis

Should a linebreak and newline be added after the value?

value

The content to be inserted into the cell. This can be a LaTeX2 object, or a character string that will be converted to one.

Details

Unless asis = TRUE, tableContent(table) <- value will add "\" and a newline at the end if not present.

If the row value is higher than the number of rows in the table, blank rows will be added to fill the space between.

Value

find_tableRow() returns the indices of the entries corresponding to the content of row i of the table.

tableRow() returns a LaTeX2 object containing all of the table content in the row.

Examples

latex <- kableExtra::kbl(mtcars[1:2, 1:2], format = "latex")
parsed <- parseLatex(latex)
table <- parsed[[find_tabular(parsed)]]
find_tableRow(table, 1)

tableRow(table, 1)

tableRow(table, 5) <- "a & b & c"
table


parseLatex documentation built on April 3, 2025, 5:27 p.m.