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 = 0, check_headers = TRUE)

## 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 main_title(), subtitles(), main_footer(), and 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))


Roche/rtables documentation built on April 30, 2024, 11:18 p.m.