insert_rrow: *Deprecated:* Insert 'rrow's at (before) a specific location

View source: R/tt_compatibility.R

insert_rrowR Documentation

Deprecated: Insert rrows at (before) a specific location

Description

This function is deprecated and will be removed in a future release of rtables. Please use insert_row_at_path() or label_at_path() instead.

Usage

insert_rrow(tbl, rrow, at = 1, ascontent = FALSE)

Arguments

tbl

(VTableTree)
a rtable object.

rrow

(TableRow)
an rrow to append to tbl.

at

(integer(1))
position into which to put the rrow, defaults to beginning (i.e. row 1).

ascontent

(flag)
currently ignored.

Value

A TableTree of the same specific class as tbl.

Note

Label rows (i.e. a row with no data values, only a row.name) can only be inserted at positions which do not already contain a label row when there is a non-trivial nested row structure in tbl.

Examples

o <- options(warn = 0)
lyt <- basic_table() %>%
  split_cols_by("Species") %>%
  analyze("Sepal.Length")

tbl <- build_table(lyt, iris)

insert_rrow(tbl, rrow("Hello World"))
insert_rrow(tbl, rrow("Hello World"), at = 2)

lyt2 <- basic_table() %>%
  split_cols_by("Species") %>%
  split_rows_by("Species") %>%
  analyze("Sepal.Length")

tbl2 <- build_table(lyt2, iris)

insert_rrow(tbl2, rrow("Hello World"))
insert_rrow(tbl2, rrow("Hello World"), at = 2)
insert_rrow(tbl2, rrow("Hello World"), at = 4)

insert_rrow(tbl2, rrow("new row", 5, 6, 7))

insert_rrow(tbl2, rrow("new row", 5, 6, 7), at = 3)

options(o)


Roche/rtables documentation built on April 20, 2024, 9:16 p.m.