rbind: Row-bind 'TableTree' and related objects

rbindl_rtablesR Documentation

Row-bind TableTree and related objects

Description

Row-bind TableTree and related objects

Usage

rbindl_rtables(
  x,
  gap = lifecycle::deprecated(),
  check_headers = lifecycle::deprecated()
)

## S4 method for signature 'VTableNodeInfo'
rbind(..., deparse.level = 1)

## S4 method for signature 'VTableNodeInfo,ANY'
rbind2(x, y)

Arguments

x

(VTableNodeInfo)
TableTree, ElementaryTable, or TableRow object.

gap

[Deprecated] ignored.

check_headers

[Deprecated] ignored.

...

(ANY)
elements to be stacked.

deparse.level

(numeric(1))
currently ignored.

y

(VTableNodeInfo)
TableTree, ElementaryTable, or TableRow object.

Value

A formal table object.

Note

When objects are row-bound, titles and footer information is retained from the first object (if any exists) if all other objects have no titles/footers or have identical titles/footers. Otherwise, all titles/footers are removed and must be set for the bound table via the formatters::main_title(), formatters::subtitles(), formatters::main_footer(), and formatters::prov_footer() functions.

Examples

mtbl <- rtable(
  header = rheader(
    rrow(row.name = NULL, rcell("Sepal.Length", colspan = 2), rcell("Petal.Length", colspan = 2)),
    rrow(NULL, "mean", "median", "mean", "median")
  ),
  rrow(
    row.name = "All Species",
    mean(iris$Sepal.Length), median(iris$Sepal.Length),
    mean(iris$Petal.Length), median(iris$Petal.Length),
    format = "xx.xx"
  )
)

mtbl2 <- with(subset(iris, Species == "setosa"), rtable(
  header = rheader(
    rrow(row.name = NULL, rcell("Sepal.Length", colspan = 2), rcell("Petal.Length", colspan = 2)),
    rrow(NULL, "mean", "median", "mean", "median")
  ),
  rrow(
    row.name = "Setosa",
    mean(Sepal.Length), median(Sepal.Length),
    mean(Petal.Length), median(Petal.Length),
    format = "xx.xx"
  )
))

rbind(mtbl, mtbl2)
rbind(mtbl, rrow(), mtbl2)
rbind(mtbl, rrow("aaa"), indent(mtbl2))


rtables documentation built on Sept. 30, 2024, 9:32 a.m.